Windows Sockets is a network programming interface that is widely used and open in windows and supports multiple protocols.
1. connection-oriented stream calling process (TCP ):
Server Client
Call wsastartup () to initialize Winsock call wsastartup () to initialize Winsock
|
Call socket () to create a listener SOCKET call socket () to create a session socket
|
Call BIND () to specify the communication object for the listening socket |
|
Call listen () to set the pending connection status |
|
Call accept () to receive connections and generate session scocket |
|
| Call connect () to connect to the server
|
Call send and Recv for session call send and Recv for session
|
Closesocket () Close socket
2. Call process (UDP) for connectionless datagram ):
Server Client
Call wsastartup () to initialize Winsock call wsastartup () to initialize Winsock
|
Call socket () to create a listener SOCKET call socket () to create a session socket
|
|
Call sendto and recvfrom for session call sendto and recvfrom for session
|
Closesocket () Close socket