Sends a data unit to another transport user.
Transport Layer Interface Library (libtli.a)
The t_sndudata subroutine is used in connectionless mode to send a data unit to another transport user.
By default, the t_sndudata subroutine operates in synchronous mode and may wait if flow-control restrictions prevent the data from being accepted by the local transport provider at the time the call is made. However, if the O_NDELAY or O_NONBLOCK flag is set (using the t_opensubroutine or the fcntl command), the t_sndudata subroutine runs in asynchronous mode and fails under such conditions.
Item | Description |
---|---|
fd | Identifies the local transport endpoint through which data is sent. |
unitdata | Points to a t_unitdata structure containing the following
elements:
The elements are defined as follows:
If the len field of the udata field is 0, no data unit is passed to the transport provider; the t_sndudata subroutine does not send zero-length data units. If the t_sndudata subroutine is issued from an invalid state, or if the amount of data specified in the udata field exceeds the TSDU size as returned by the t_open or t_getinfo subroutine, the provider generates an EPROTO protocol error. |
On successful completion, the t_sndudata subroutine returns a value of 0. Otherwise, it returns a value of -1 and sets the t_errno variable to indicate the error.
If unsuccessful, the t_errno variable is set to one of the following:
Value | Description |
---|---|
TBADDATA | The amount of user data specified was not within the bounds allowed by the transport provider. |
TBADF | The specified file descriptor does not refer to a transport endpoint. |
TFLOW | The O_NDELAY or O_NONBLOCK flag was set, but the flow-control mechanism prevented the transport provider from accepting data at this time. |
TLOOK | An asynchronous event has occurred on this transport end point and requires immediate attention. |
TNOTSUPPORT | This subroutine is not supported by the underlying transport provider. |
TOUTSTATE | This subroutine was issued in the wrong sequence. |
TSYSERR | A system error has occurred during execution of this subroutine. |