X/Open Transport Interface Library (libxti.a)
#include <xti.h> int t_sndudata ( int fd, const struct t_unitdata *unitdata)
The t_sndudata subroutine is used in connectionless mode to send a data unit from another transport user.
By default, the t_sndudata subroutine operates in synchronous mode and waits if flow control restrictions prevents the data from being accepted by the local transport provider at the time the call is made. However, if O_NONBLOCK is set (via the t_open subroutine or fcntl), the t_sndudata subroutine executes in asynchronous mode and fails under such conditions. The process can arrange to be notified of the clearance of a flow control restriction via either the t_look subroutine or the Event Management interface.
If the amount of data specified in the udata field exceeds the TSDU size as returned in the t_open or t_getinfo subroutines info parameter tsdu field, a TBADDATA error will be generated. If the t_sndudata subroutine is called before the destination user has activated its transport endpoint (see the t_bind subroutine), the data unit may be discarded.
If it is not possible for the transport provider to immediately detect the conditions that cause the errors TBADDADDR and TBADOPT. These errors will alternatively be returned by the t_rcvuderr subroutine. Therefore, an application must be prepared to receive these errors in both of these ways.
0 | Successful completion. |
-1 | t_errno is set to indicate an error. |
On failure, t_errno is set to one of the following:
TBADADDR | The specified protocol address was in an incorrect format or contained illegal information. |
TBADDATA | Illegal amount of data. A single send was attempted specifying a TSDU greater than that specified in the info parameter, or a send of a zero byte TSDU is not supported by the provider. |
TBADF | The specified file descriptor does not refer to a transport endpoint. |
TBADOPT | The specified options were in an incorrect format or contained illegal information. |
TFLOW | O_NONBLOCK was set, but the flow control mechanism prevented the transport provider from accepting any data at this time. |
TLOOK | An asynchronous event has occurred on the transport endpoint. |
TNOTSUPPORT | This subroutine is not supported by the underlying transport provider. |
TOUTSTATE | The subroutine was issued in the wrong sequence on the transport endpoint referenced by the fd parameter. |
TPROTO | This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno). |
TSYSERR | A system error has occurred during execution of this subroutine. |
The fcntl subroutine, t_alloc subroutine, t_open subroutine, t_rcvudata subroutine, t_rcvuderr subroutine.