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


connect() call

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

A connect() call attempts to establish a connection between a local socket and a remote socket. For a stream socket, the call performs two tasks. First, it completes the binding necessary for a stream socket in case it has not been previously bound by a bind() call. Second, it attempts to make a connection to another socket.

The connect() call on a stream socket is used by a client application to establish a connection to a server. To be able to accept a connection with an accept() call, the server must have a passive open pending, which means it must have successfully called bind() and listen() before the client issues connect().

If the socket is in blocking mode, the connect() call blocks the caller until the connection is set up, or until an error is received. If the socket is in nonblocking mode and no errors occurred, the return codes indicate that the connection can be initiated. The caller can test the completion of the connection setup by calling select() and testing for the ability to write to the socket.

Stream sockets can call connect() one time only.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014