Socket Types
Type | Explanation |
TCP | Similar to the WinSock SOCK_STREAM type. Provides sequenced, reliable, two-way, (full-duplex) connection-based byte streams with an out-of-band data transmission mechanism. Uses TCP for the Internet address family. |
UDP | Similar to the WinSock SOCK_DGRAM type. Supports datagrams, which are connectionless, unreliable buffers of a fixed (typically small) maximum length. Uses UDP for the Internet address family. |
To establish a TCP connection, the following steps are implemented:
Operation | WinSock | VuGen function | Client/Server |
Open socket | socket | client and server | |
Name socket | bind | client (optional) and server | |
Prepare to associate with another socket | listen | server | |
Initiate association | connect | client | |
Complete association | accept | server | |
Receive/Send | recv/send | client and server |
To establish a UDP connection, the following steps are implemented:
Operation | WinSock | VuGen function | Client/Server |
Open socket | socket | client and server | |
Name socket | bind | client and server | |
Associate Sockets: Receive/Send | recvfrom /sendto | client and server |