z/OS Communications Server: IP CICS Sockets Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


accept() call

z/OS Communications Server: IP CICS Sockets Guide
SC27-3649-00

A server issues the accept() call to accept a connection request from a client. The call uses a socket already created with a socket() call and marked by a listen() call.

An accept() call

  1. Accepts the first connection on its queue of pending connections.
  2. Creates a new socket with the same properties as the socket used in the call.
  3. Returns the new socket descriptor to the server.

The new socket cannot be used to accept new connections, but is used by the client for application purposes. The server issues a givesocket() call and a CICS® START command to enable a child server to communicate with the client for application purposes. The original socket remains available to the server to accept more connection requests.

The accept() call optionally saves the connection requester’s address for use by the server.
Note:
  • If the queue has no pending connection requests, accept() blocks the socket unless the socket is in nonblocking mode. The socket can be set to nonblocking by calling ioctl().
  • accept() calls are the only way to screen clients. The application cannot predetermine clients from which it accepts connections, but it can close a connection immediately after discovering the identity of the client.
  • The select() call checks a socket for incoming connection requests.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014