HP X.25/9000 Programmer's Guide
Chapter 3 29
Establishing and Terminating a Socket Connection
Connection Establishment for the Server Process
that the server will handle. For a description of the issues associated
with addressing, see Chapter 2 , “X.25 Addressing.”
addrlen Length of the x25addrstr structure in bytes.
error If the call completes successfully,
error
contains a 0. If the system call
encountered an error, –1 is returned in
error
and
errno
contains the
cause of the error.
Refer to the bind(2) entry in your man pages for more information.
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.
Preparing a Listen Socket
The listen() system call prepares a socket to receive CALL
INDICATION packets whose address matches the address previously
bound to the socket with a bind() call. All eligible CALL INDICATION
packets are put into this queue. The server cannot receive a connection
request until it has executed a listen() call.
Syntax for listen()
The listen() system call and its parameters are described below.
int error;
int sd, backlog;
error = listen(sd, backlog);
sd A socket descriptor for a created and bound socket on which the process
will wait for incoming CALL INDICATION packets.
backlog Maximum length of the listen queue (range: 1 to 20). Additional
incoming CALL INDICATION packets will be placed in the queue
regardless of the value specified. This allows the system to handle traffic
surges without unexpected disconnections.
36960-90061.bk Page 29 Friday, November 10, 2000 3:42 PM










