t_rcv(3xti_spx)


t_rcv -- receive data over an established transport connection

Synopsis

#include "spx_app.h" 

int t_rcv ( int spxFd, char *buf, unsigned int nbytes, int *flags )

Parameters

(IN) spxFd
Passes the file descriptor of the local transport endpoint.

(IN) buf
Passes the address of a buffer that will receive the data.

(IN) nbytes
Passes the maximum number of data bytes expected to be received.

(IN) flags
Passes the address of an integer that will indicate whether there is more data to receive. SPX/SPXII does not support the T_EXPEDITED flag.

(OUT) flags
Receives the flag (T_MORE) that indicates whether there is more data to receive.

Return values

>=0
Successful. Returns the number of bytes accepted by SPX/SPXII

-1
Unsuccessful
If the t_rcv is successful, the value returned is the actual number of data bytes received. Refer to t_rcv(3xti) and ``Programming with the X/Open Transport Interface (XTI)'' for additional errors that may occur with this call.

If the watchdog determines that the remote transport endpoint is no longer participating in the connection, the watchdog generates a disconnect indication which causes t_rcv to return with a T_LOOK error. (See t_rcvdis for more information.)

Remarks

The t_rcv function works as specified in ``Programming with the X/Open Transport Interface (XTI)'', except that the T_EXPEDITED flag is never set.

SPX/SPXII does perform flow control. If SPX/SPXII determines that the remote endpoint is sending data faster than the application can receive the data, a packet is sent notifying the remote endpoint to stop sending data. When the application receives all of the data queued for it, SPX/SPXII notifies the remote endpoint to begin sending data again.

The watchdog in the SPXII driver prevents blocking forever for a packet. For example, suppose a local transport endpoint blocks waiting for an incoming packet. While the local transport blocks, the remote transport endpoint goes away before sending the packet. In this event, the local transport endpoint could block forever. However, the watchdog solves this problem by periodically checking all active connections.

State

The t_rcv call is allowed only in the T_DATAXFER state. The state does not change on successful completion of the call.

References

t_look(3xti), t_open(3xti_spx), t_rcv(3xti), t_rcvdis(3xti_spx), t_snd(3xti_spx)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.