next up previous
Next: 8 Special IP addresses Up: Simulation Environment Overview 15-441 Previous: 6.0.5 The Setsockopt() call


7 TCP

Typically, there are two types of applications that use TCP sockets - servers and clients. A TCP server listens on a well-known port (or IP address and port pair) and accepts connections from TCP clients. A TCP client initiates a connection request to a TCP server in order to setup a connection with the server. A real TCP server can accept multiple connections on a socket. A server socket in the simulator accepts only one TCP connection in its lifetime.

Below is the sequence of socket calls made by a TCP server and a TCP client:

Server: Socket -> Bind -> Accept -> Read/Write -> Close
Client: Socket -> (Bind) -> Connect -> Read/Write -> Close

Below are the details of the socket calls specification.


next up previous
Next: 8 Special IP addresses Up: Simulation Environment Overview 15-441 Previous: 6.0.5 The Setsockopt() call