z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Steps for creating an ancillary socket

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

This topic describes the steps of creating an ancillary socket.

Before you begin

Ensure that the ancillary socket is not closed until all stream sockets that might reference those shared memory objects are closed. This can be accomplished by taking advantage of the fact that the UNIX System Services process cleanup service closes sockets sequentially from lowest-numbered socket descriptor to highest-numbered socket descriptor.

Procedure

Perform the following steps:

  1. Issue a getrlimits() request to discover the largest socket descriptor available for the process.
  2. Issue a dup2() request to copy the original ancillary socket descriptor to the largest socket descriptor obtained from the getrlimits() request.
  3. Close the original ancillary socket descriptor.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014