Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Binding with a known port number z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
In C, the server puts the port number and IP address into structure sockaddr_, x, passing it, and the socket, to the bind() function. For example:
After an application possesses a socket descriptor, it
can explicitly bind() a unique address to that socket, as in the example
listed in Figure 1. For more information
about binding, see bind().
Figure 1. An application using the
bind() call
This example binds socket descriptor s to
the address 129.5.24.1, and port 1024 to
the internet domain. Servers must bind to an address and port to be
accessible to the network. The example in Figure 1 lists two utility routines:
|
Copyright IBM Corporation 1990, 2014
|