WinSocket question

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

WinSocket question

 
0
  #1
Jun 24th, 2007
Hello,

I have a server and client file.

In Client I have
  1. WSADATA WsaData;
  2. SOCKET Socket;

In server I have
  1. WSADATA xxx;
  2. SOCKET yyy;

This is same in both files:
  1. sock_addr.sin_port = htons(1234);
Will this connection be established?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,413
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1470
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: WinSocket question

 
0
  #2
Jun 24th, 2007
No. here is one of many tutorials found with google.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: WinSocket question

 
0
  #3
Jun 24th, 2007
the server will bind to an address and start listening on it. the client socket is usually dynamically bound and tries to connect to the socket at the address the server has bound. so the port the client tries to connect to should be the same as the one the server used in the call to bind.
1234 is not an ideal choice for the port though. see http://en.wikipedia.org/wiki/List_of...P_port_numbers

will this connection be established? can't say. the port may already be in use (for 1234, this is likely in windows), the connection may be blocked/dropped by a firewall etc.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: WinSocket question

 
0
  #4
Jun 25th, 2007
OK, thanks

It works now.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC