The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
server/client performance tomjan UNIX and Linux Applications 1 05-28-2008 09:16 AM
Server client program pip3r High Level Programming 9 04-17-2008 02:15 AM
client/server bole UNIX for Dummies Questions & Answers 2 10-30-2006 02:19 AM
ntp server and ntp client bubba112557 SUN Solaris 1 05-10-2005 11:37 AM
What's the difference between an SSH Client and an SSH Server? PSC Security 1 07-19-2004 04:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-17-2008
mlhazan mlhazan is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 11
client/server compile question

Hi,
I have 2 files-->server.c and client.c
My server.c takes local ip as saying:

Code:
*.sin_addr.s_addr=INADDR_ANY;

client.c is in the same machine.It has a line like:

Code:
*.sin_addr.s_addr=inet_addr(argv[1]);

I don't know how to compile.I tried

Code:
./client 127.0.0.1

It used port 7777 in both client and server.I think i have missed something.
But it works when I use port 80.Do you know why??

I would like to post the client.c and server.c but I know if do so
people will start giving there advice.

This is a small program.It only connects the client on server.
  #2 (permalink)  
Old 08-17-2008
redoubtable redoubtable is offline
Registered User
  
 

Join Date: Aug 2008
Location: Portugal
Posts: 242
If it's working on one port and not on the other it means you're probably being blocked by a firewall or something. Is there any error when trying to create / connect the client / server in 7777 ? (if not, it's definitely a firewall).

Oh, if you try to bind a server in a low port ( < 1024 ) such as 80 you will need UID 0 (generally root).
  #3 (permalink)  
Old 08-18-2008
iamcollins iamcollins is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
Hi

Could you please tell us what is the value set for .sin_port ? This should be the port the server is listening to... and client should also have the same port set for .sin_port as like server to get connected

Regards
Collins
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0