Winsock Initial Connection!

steveo555
steveo555 used Ask the Experts™
on
Can anyone tell me exactly what TCP traffic is send and recieved when a client socket tries to connect to the server socket. Before the GetClientThread event fires on the server socket? I.e. What is the initial connection handshake etc before you can use the socket?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer, Advisory
Top Expert 2005
Commented:

MSDN excerpt:

When a process creates a TCP socket in the Microsoft Winsock layer and issues a connect() call to some host and port number, the TCP protocol performs its standard "three-way handshake" of a SYN packet, acknowledged by the target host with ACK/SYN, and a final ACK from the initiating client. Basically works out as:

client                                  host
------                                  ----
SYN   -------------------------------->
      <-------------------------------- ACK/SYN
ACK   -------------------------------->


-------
Russell
what i suggest you do if you want to know the exact bytes that are exchanged during the handshake is you download yourself a packet sniffer and that will read off the packet (a packet is the hole chunkes of data send in tcp form) headders to reveal what you want to know.

Just do a search on google for a packet sniffer! that should help you with your problem.
steveo555:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial