t_sndudata(3xti)t_sndudata(3xti)Namet_sndudata - send a data unit
Syntax
#include <xti.h>
int t_sndudata(fd, unitdata)
int fd;
struct t_unitdata *unitdata;
Arguments
fd Identifies the local transport endpoint through which data
will be sent.
unitdata Points to a t_unitdata structure containing the following
members:
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
The members have the following meanings:
addr Specifies the protocol address of the destination
user.
opt Identifies protocol-specific options that the
user wants associated with the request.
udata Specifies the user data to be sent.
Description
This function is used in connectionless mode to send a data unit to
another transport user.
──────────────────────────────────────────────────
Parameters Before Call After Call
──────────────────────────────────────────────────
fd x /
unitdata->addr.maxlen / /
unitdata->addr.len x /
unitdata->opt.maxlen / /
unitdata->opt.len x /
unitdata->opt.buf ?(?) /
unitdata->udata.maxlen / /
unitdata->udata.len x /
unitdata->udata.buf x(x) /
──────────────────────────────────────────────────
If the len field of udata is zero, and sending of zero octets is not
supported by the underlying transport service, the returns -1 with
t_errno set to [TBADDATA].
By default, operates in synchronous mode and may wait if flow control
restrictions prevent the data from being accepted by the local trans‐
port provider at the time the call is made. However, if O_NONBLOCK is
set by means of or executes in asynchronous mode and fails under such
conditions. The process can arrange to be notified of the clearance of
a flow control restriction by means of
If the amount of data specified in udata exceeds the TSDU size as
returned in the tsdu field of the info argument of or the provider gen‐
erates a protocol error. See [TSYSERR] under the DIAGNOSTICS section.
If is issued before the destination user has activated its transport
endpoint, the data unit can be discarded.
Return Values
Upon successful completion, a value of 0 is returned. On failure, a
value of -1 is returned, and t_errno is set to indicate the error.
Diagnostics
On failure, t_errno is set to one of the following:
[TBADF] The specified file descriptor does not refer to a
transport endpoint.
[TOUTSTATE] The function was issued in the wrong sequence on
the transport endpoint referenced by fd.
[TFLOW] O_NONBLOCK was set, but the flow control mechanism
prevented the transport provider from accepting any
data at this time.
[TBADDATA] Illegal amount of data; zero octets are not sup‐
ported.
[TLOOK] An asynchronous event has occurred on the transport
endpoint.
[TNOTSUPPORT] This function is not supported by the underlying
transport provider.
[TSYSERR] A system error has occurred during execution of
this function. A protocol error cannot cause to
fail until a subsequent access of the transport
endpoint.
See Alsofcntl(2), t_alloc(3xti), t_open(3xti), t_rcvudata(3xti), t_rcvud‐
err(3xti)t_sndudata(3xti)