Solstice X.25 9.2 Developer's Guide

3.3.2 Receiving Expedited Data

The preceding example allows for the possibility of receiving expedited data messages, which are carried in X.25 interrupt packets. These must be dealt with appropriately. Since only one expedited data packet can be outstanding in the connection at any time, its sender is prevented from sending any further such messages until the receiver has acknowledged it. The receiver does this by sending an Expedited Acknowledgment (EAck) message. The EAck is sent in the same way as an ordinary data packet, but with no data part.

If an application does not need to use the expedited data capability, then it responds to receiving an EData by resetting or closing the connection.

When sending expedited data, the application must wait for an acknowledgment before requesting further expedited transmissions.

char expdata[]= {1, 2, 3, 4};
 exp.xl_type= XL_CTL;
 exp.xl_command= N_Edata;
 ctlblk.len= sizeof (struct xedataf);
 ctlblk.buf= (char *) &exp;
 datblk.len= EXPLEN;
 datblk.buf= expdata;
 if (putmsg(x25_fd, &ctlblk, &datblk, 0) < 0) {
 	error("Exp putmsg");
 	exit(1);
 	}
 for (;;) {
 	if (getmsg(x25_fd, &ctlblk, &datblk, &getflags) < 0) {
 	perror("Getmsg fail");
 	exit(1);
 	}
 hdrptr = (S_X25_HDR *) ctlbuf;
 if (hdrptr->xl_type == XL_CTL) {
 /* Deal with protocol message as required */
 	}
 if (hdrptr->xl_type == XL_DAT) {
 	dat_msg = (struct xdataf *) ctlbuf;
 	switch (dat_msg->xl_command) {
 		case N_Data:
 /* process more data */
 			break;
 		case N_EData:
 			printf("***Expedited data received \n");
 /* Must deal with */
 .... send N_EAck ....
 			break;
 		case N_EAck:  /* Expedited data received */
 /* Further N_Edata can now be sent */
 			break;
 		default:
 			break;
 		}
 	}