Solstice X.25 9.2 Developer's Guide

12.7.7 Accessing High Water Marks of Socket

The AF_X25 socket provides a flow control mechanism using high and low water marks on both the send and receive sides of an X.25 virtual circuit. When the amount of queued data goes above the high water mark, additional data is blocked until the queued data falls below the low water mark. Blocking received data is accomplished by not acknowledging receipt of packets until the user reads the data. Blocking send data is accomplished by blocking the user process invoking send or write.

The default high water mark for both sending and receiving is 2048 bytes. The low water mark is always set to half the high water mark. Note that the high water mark is only an approximation of the maximum amount of data allowed to be queued up.

A user process may set or read the high water mark as described below. To read:

typedef struct so_hiwat_db_s {
    short   sendhiwat;
    short   recvhiwat;
 } SO_HIWAT_DB;
 SO_HIWAT_DB hiwater;
 int s, error;
 error = ioctl(s, X25_RD_SBHIWAT, &hiwater);

To write:

error = ioctl(s, X25_WR_SBHIWAT, &hiwater);