HP X.25/9000 Programmer's Guide
102 Chapter6
Extended Features
Reestablishing Terminated Connections
Reestablishing Terminated Connections
Maintaining a connection over an X.25 network may not suit all
applications. For example, a client may send a request to a server that
may require processing for an extended period of time before a reply can
be sent. It would not be economical to maintain the connection until data
processing has been completed. A more cost-effective method is to clear
the connection, then reestablish it from the server side when the server
finishes processing the data.
Usually, in a CALL REQUEST packet, only the X.121 address of the
interface being used is written into the calling address field. The
ioctl(X25_WR_CALLING_SUBADDR) writes a subaddress as a suffix to the
calling address field in the CALL REQUEST packet. The server can read
this data and save it until the connection is reestablished.
If the server is using the X.25 interface, the getpeername() system call
will return the subaddress information formatted in an
x25addrstr
structure. The server then stores the information (
x25addrstr
structure) until the server reestablishes the connection.
When protocol IDs are used, the reestablishment proceeds as discussed
above. However, the server must know the protocol ID to which it will
connect. The protocol ID can be stored in the user data field of the CALL
REQUEST packet. This must be designed into the application on both
sides of the connection. There is no standard specifying the way to
transfer the protocol ID of the caller through X.25.
Syntax for ioctl (X25_WR_CALLING_SUBADDR)
The ioctl(X25_WR_CALLING_SUBADDR) call and its parameters are
described below. For a description of
x25addrstr
, refer to “Preparing
adress variables” in Chapter 2.
int err;
int sd;
struct subaddr;
err = ioctl(sd, X25_WR_CALLING_SUBADDR, &subaddr);
sd A socket descriptor for a VC socket which has not yet been connected.
36960-90061.bk Page 102 Friday, November 10, 2000 3:42 PM










