HP X.25/9000 Programmer's Guide
Chapter 4 59
Sending and Receiving Data
Using Nonblocking I/O
are described below:
• accept() returns immediately. If there are no connection requests in
the listen queue, accept() returns –1 and the EWOULDBLOCK
error is contained in errno. If a connection request is present in the
listen queue, accept() returns a socket descriptor for the VC.
• connect() returns –1 immediately and the EINPROGRESS error is
contained in errno. You can poll the socket with the select() call,
which returns “writable” when the connection is established. At that
point data can be retrieved from the CALL ACCEPTED packet with
ioctl(X25_RD_USER_DATA), and data can be sent and received with
send() and recv() calls.
• recv() and read() return immediately. If there is a complete
message to be received in the X.25 buffer space, the data is returned
immediately. Ifno data is available to be received, recv() and read()
return the value –1 and the EWOULDBLOCK error is contained in
errno.
• send() and write() return immediately. If there is X.25 buffer space
available for the send() or write() buffer, the data is transferred to
the X.25 buffer space and sent in the order it was received. If there is
no available buffer space for the data to be transmitted, send() and
write() return the value –1 and the EWOULDBLOCK error is
placed in errno. Should this occur, the call must be reissued at a later
time.
• Series 800 only: send() and write() with the D bit set return
immediately. When the D bit is set, the data is transmitted as
described above. When the D bit confirmation arrives the X.25
subsystem sends a SIGURG signal to the process, and the event
OOB_VC_DBIT_CONF
is added to the out-of-band queue. While waiting
for D bit confirmation, the process must not send any more data until
confirmation is received.
• send(MSG_OOB) returns immediately. If there is X.25 out-of-band
buffer space available, the data is transferred into it and sent. If there
is no available out-of-band buffer space for the data to be transmitted
send() returns the value –1 and the EWOULDBLOCK error is
placed in
errno
. The call must be reissued at a later time. The use of
send() to transmit out-of-band data is more fully described in
Chapter 5 , “Receiving and Transmitting Out-of-band Information.”
When the INTERRUPT CONFIRMATION packet arrives, the subsystem
sends a SIGURG signal to the process with
OOB_VC_INTERRUPT_CONF
in
36960-90061.bk Page 59 Friday, November 10, 2000 3:42 PM










