HP X.25/9000 Programmer's Guide
36 Chapter3
Establishing and Terminating a Socket Connection
Connection Establishment for the Client Process
NOTE The first initialized interface is the one that is first initialized when the
sub-system is restarted after all cards are stopped.
You can use the
x25ifname
field to control performance. Each interface
used to connect to a particular network can only support a fixed number
of circuits. When selecting the network interface you should also
consider bandwidth, throughput, and response-time factors.
NOTE Facilities such as call user data (or the circuit’s D bit) must be specified
before issuing the connect() call. Facilities are specified with
ioctl(X25_WR_FACILITIES), and call user data is specified with
ioctl(X25_WR_USER_DATA). The D bit can be set with
ioctl(X25_SEND_TYPE). These ioctl() calls are described in the
following chapters.
If the client and server are using protocol IDs for address matching prior
to issuing the connect() call, the client must specify the server's
protocol ID with the ioctl(X25_WR_USER_DATA) call (see “The
ioctl(X25_WR_USER_DATA) Call” in Chapter 5). The example below
describes how to use ioctl(X25_WR_USER_DATA) to specify a remote
protocol ID.
Example (client specifying the protocol ID)
The example below shows the system calls a client must execute if the
protocol ID is to be specified in the CALL REQUEST packet.
/* put the protocol ID in the call-user data field */
struct x25_userdata userdata;
...
userdata.x25_cud_len = 1; /* one byte for PID */
userdata.x25_cu_data[0] = 0x05; /*PID is 0x05 */
result = ioctl(s, X25_WR_USER_DATA, &userdata);
...
result = connect (s, &peeraddr, sizeof(struct x25addrstr));
Refer to the connect(2) entry in your man pages for more information.
36960-90061.bk Page 36 Friday, November 10, 2000 3:42 PM










