Explain the meaning of ACCEPT socket primitive.
The Accept Primitive:
A server which uses connection-oriented transport should call procedure accepts to accept the next connection request. If requests as there in the queue then accept returns instantly; if no request has arrived the system blocks the server till a client forms a connection. The accept call has the form as:
newsock= accept(socket , caddress, addresslen)
Argument socket is the descriptor of a socket the server which has created and bound to an exact protocol port. Argument caddress is the address of a structure of kind sockaddr and caddresslen is a pointer for an integer. Accept fills into fields of argument caddress with the address of the client that made the connection and sets caddresslen to the length of the address.