CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Naming Sockets, continued

The related call connect() takes the same arguments but binds an address to the remote end of the socket.

For connectionless protocols, such as UDP/IP, the kernel caches the destination address associated with the socket.

Server processes bind address to sockets and 'advertise' their names to identify themselves to clients.

Connection Establishment

Servers accept connections from remote clients and cannot use connect() because they do not (usually) know the address of the remote client until the client has initiated a connection.

Applications use listen() and accept() to perform passive opens.

When a server arranges to accept data over a virtual circuit, the kernel must arrange to queue requests until they can be serviced.

listen(sd, queue_length);

listen() only indicates that an application is willing to accept requests; applications call accept() to accept them.

new_socket = accept(sd, from, fromlength);

When accept() returns, from contains the network address of the remote end of the socket, and new_socket is in a connected state.


CITS3002 Computer Networks, Lecture 8, Transport layer protocols and APIs, p13, 24th April 2024.