HP X.25/9000 Programmer's Guide
54 Chapter4
Sending and Receiving Data
Data Transmission Requirements
automatically scattered across several DATA packets as part of the X.25
protocol. Each packet will have its M bit (“More” bit) set, except for the
last packet, to indicate that there is at least one more packet to follow.
Once the last packet (the one without an M bit) has been received, the
message is assembled again.
If X.25 receives a series of packets with the M bit set, the packets must
be read with a single system call, or as a series of message fragments. If
the application is reading message fragments the
ioctl(X25_SET_FRAGMENT_SIZE) must be set.
The MDTF Bit
Although the M bit can not be set by the application, the MDTF (More
Data to Follow) bit—an extension of the X.25 protocol specific to this X.25
implementation—can be used by an application to force the M bit to be
set. This allows an application to use several send() calls to send a
message, even if the message is small enough to be sent as a single
packet. The packets will be assembled and interpreted as a single
message at the other end.
To send a message with several send() calls, use the
ioctl(X25_SEND_TYPE) call with the
X25_MDTF_BIT
set to 1. All
subsequent send() or write() calls will be treated as fragments of a
large message. That is, all of the packets used to send the data have their
M bits set.
To clear the M bit on a message use ioctl(X25_SEND_TYPE) with the
X25_MDTF_BIT
call cleared (set to 0). This must be done before the last
send() or write() call in the message series so that the final packet
does not have the M bit set. Refer to “Controlling the MDTF, D, and Q
bits” below for the syntax for ioctl(X25_SEND_TYPE).
Unless the ioctl(X25_SET_FRAGMENT_SIZE) system call is used with
the MDTF bit, messages must be received with a single recv() or
read() system call. If the ioctl(X25_SET_FRAGMENT_SIZE) system call
is used, however, the message is read as a series of message fragments,
allowing very long messages to be read.
Using the D (Delivery Confirmation) Bit
When the D bit (Delivery Confirmation bit) is set in a DATA packet, it
requires that confirmation be sent upon its arrival at the remote DTE. To
use the D bit in data transmission, the D bit must be set at connection
36960-90061.bk Page 54 Friday, November 10, 2000 3:42 PM










