Receives an incoming packet and indicates the packet type.
X.25 Communications Library (libx25s.a)
int x25_receive(conn_id, cb_msg) int *conn_id; struct cb_msg_struct *cb_msg;
The x25_receive subroutine is used to receive incoming calls and messages and monitor data for connected calls. One x25_receive subroutine call receives a complete packet sequence. In the event that an interrupt packet is received, an interrupt confirmation is sent automatically by the system.
|conn_id|| Contains a pointer to an integer that contains the listen identifier.
Note: If the call is successfully received, an open file is created in the current process that is used by the API library functions for subsequent communication on this connection. The file is closed when the call is cleared.
To receive a message for any connected call, a pointer to an integer that contains a value of 0.
To receive a message for a specific connected call, a pointer to an integer that contains the connection identifier of the call.
To receive monitoring data for a call, a pointer to an integer that contains the connection identifier returned by the x25_link_monitor subroutine.
On return from this subroutine, in all cases, a pointer to an integer that now contains the actual connection identifier.
|cb_msg||Specifies a pointer to the message structure, cb_msg_struct, which includes the msg_type field. This structure is allocated by the API; it is the responsibility of the application to free this memory.|
If successful, the x25_receive subroutine returns a nonnegative value. If an error occurs, the x25_receive subroutine returns a value of -1 and sets the x25_errno global variable to one of the error codes shown below.
On failure, the x25_errno global variable is set to one of the following values:
If the x25_errno global variable is set to a X25SYSERR value, the errno global variable is set to an EINTR value.
This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.
The x25_send subroutine.
Processing Calls with the X.25 API, Using the X.25 Structures and Flags, in AIX Version 4.3 Communications Programming Concepts.