HP X.25/9000 Programmer's Guide
30 Chapter3
Establishing and Terminating a Socket Connection
Connection Establishment for the Server Process
error If the call completes successfully,
error
contains a 0. If an error is
encountered, –1 is returned in
error
and
errno
contains the cause of the
error.
Incoming CALL INDICATION packets that match the socket’s bind
address (and the sockets created for them) are placed in the listen queue
in the order in which they are received. Backlog requests can be waiting
in the listen queue at the same time. You cannot send or receive data on
a listen socket. Listen sockets only act as meeting points for incoming
calls.
Once a listen() call has been executed on a socket, calls that have a
listener are queued on a listen() socket but not acted upon until the
accept() is completed on the socket. This prevents time-outs from
taking place while a client's request waits in the listen queue. A new
socket is created along with all of the resources required to operate it
including send and receive buffers.
CAUTION If the
bind_addr
parameter specifies a specific interface name (that is,
call-matching by X.25 interface name), the corresponding X.25 interface
must be initialized before a bind() call is issued. Even if the
bind_addr
parameter does not specify an interface name (that is, calls can be
received from any interface), at least one X.25 interface must be
initialized before the bind() call is issued.
The new socket is:
• created with the same properties as the listen() socket (family =
AF_CCITT, type = SOCK_STREAM).
• connected to the client process’s socket.
For more for more information, see “Controlling Call Acceptance” in this
chapter.
Closing the last active socket descriptor of a listen socket clears all
pending requests and empties the listen queue. The socket is unusable
after the close() call.
Refer to the listen(2) entry in your man pages for more information.
36960-90061.bk Page 30 Friday, November 10, 2000 3:42 PM










