Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
maxdesc() z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
The maxdesc() call reserves additional space in the TCP/IP address space to allow socket numbers to extend beyond the default range of 0 through 49. Socket numbers 0, 1, and 2 are never assigned, so the default maximum number of sockets is 47.
Set the integer pointed to by totdesc to
one more than the maximum socket number desired. If your program does
not use AF_INET sockets, set the integer pointed to by inetdesc to
0 . If your program uses AF_INET sockets, set the integer pointed
to by inetdesc to the same value as totdesc; maxdesc()
must be called before your program creates its first socket. Your
program should use getdtablesize() to verify that the number of sockets
has been changed.
Note: Increasing the size of the bit sets for the
select() call must be done at compile time. To increase the size of
the bit sets, before including BSDTYPES.H, define FD_SETSIZE to be
the largest value of any socket. The
default size of FD_SETSIZE is 255 sockets.
Return valuesThe value 0 indicates success. (Your
application should check the integer pointed to by inetdesc.
It might contain less than the original value, if there was insufficient
storage available in the TCP/IP address space. In this case, the desired
number of AF_INET sockets are not available.) The value -1 indicates
an error. Errno identifies the specific error.
Example
If
successful, your application can create 97 sockets, all of type AF_IUCV.
Socket numbers run from 3–99.
If successful, your application can create 97 sockets, each of which can be of type AF_INET or AF_IUCV. The socket numbers run from 3–99. Related callsselect(), socket(), getdtablesize() |
Copyright IBM Corporation 1990, 2014
|