X25WaitForEvent(3X25) — Subroutines
Digital
NAME
X25WaitForEvent − Waits for an event to occur on one or more X.25 ports
LIBRARY
X.25 Library (libx25.a)
SYNOPSIS
#include <netx25/x25.h>
int X25WaitForEvent(
int ∗ pdptr ,
int timer );
PARAMETERS
pdptrPoints to one or all port descriptors on which to wait for events. If pdptr points to an positive integer, only an event occurring on that port is returned. If pdptr points to an integer set to X25_ALLPORTS, then all existing X.25 ports are scanned for events.
timerSpecifies the time, in seconds, to wait for an event to occur on the X.25 port(s) specified by pdptr. If timer is zero, X25WaitForEvent polls the port(s), returning immediately. If timer is set to -1, X25WaitForEvent blocks indefinitely.
DESCRIPTION
The X25WaitForEvent routine tests whether any events are pending on the specified ports. If an event is detected, the routine sets the pdptr parameter to reference the port on which the event occurred, and returns the type of event detected.
The following event types are returned by this routine:
| Event Type | Description |
| X25EV_CALLCLEARED | The X.25 connection has been cleared, and clear data or a clear confirmation is pending. |
| X25EV_CALLREQUEST | An X.25 call request has arrived. |
| X25EV_DATA | Normal data has arrived. |
| X25EV_OOB | An out-of-band message has arrived. |
| X25EV_UNDEFINED | An unrecognized event occurred. |
| X25EV_TIMEOUT | No events occurred within the time specified by the timer parameter. |
If more than one event is pending, X25EV_OOB events are returned first. If X25EV_OOB events are pending on different ports, which one is returned is arbitrary. Similarly, the order in which other events are returned is arbitrary.
If timer is positive, X25WaitForEvent blocks for a maximum of timer seconds. If no event is pending, or no event occurs within that time, X25WaitForEvent returns X25EV_TIMEOUT and the contents of pdptr are unchanged.
If timer is 0, X25WaitForEvent polls for events pending on the specified X.25 port(s). If no events are pending on the specified X.25 port(s), X25WaitForEvent returns X25EV_TIMEOUT, and the contents of pdptr are unchanged.
If timer is -1, X25WaitForEvent returns immediately if an event is pending, or blocks until an event occurs on the specified X.25 port(s).
RETURN VALUES
Upon successful completion, the X25WaitForEvent routine returns the type of event detected. Otherwise, a (negative) error code is returned.
ERRORS
If the X25WaitForEvent routine fails, one of the following error codes is returned:
[X25RC_BADPD]
Invalid port descriptor specified.
[X25RC_BADTIMEVAL]
The specified timeout value is invalid.
[X25RC_SYSERR]
An operating system error occurred. The external variable errno is set to indicate the error.
RELATED INFORMATION
Functions: X25ClearCall(3X25), X25Listen(3X25), X25OpenPort(3X25), X25ReadData(3X25), X25ReadOOB(3X25).
X.25 for Digital UNIX − Programmer’s Reference Manual.