DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 
(TLI/XTI)

t_sndudata(NET)


t_sndudata -- send a data unit

Syntax

TLI syntax

cc . . . -lnsl

#include <sys/tiuser.h>

int t_sndudata (fd, unitdata) int fd; struct t_unitdata *unitdata;

XTI syntax

cc . . . -lxti

#include <xti.h>

int t_sndudata (fd, unitdata) int fd; struct t_unitdata *unitdata;

Description

The t_sndudata function is used in connectionless mode to send a data unit to another transport user. fd identifies the local transport endpoint through which data is sent, and unitdata points to a t_unitdata structure containing the following members:
   struct netbuf addr;
   struct netbuf opt;
   struct netbuf udata;
netbuf is described in netbuf(FP). In unitdata, addr specifies the protocol address of the destination user, opt identifies protocol-specific options that the user wants associated with this request, and udata specifies the user data to be sent. The user may choose not to specify what protocol options are associated with the transfer by setting the len field of opt to zero. In this case, the provider may use default options.

If the len field of udata is zero, no data unit is passed to the transport provider; t_sndudata does not send zero-length data units.

By default, t_sndudata 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 O_NONBLOCK is set (via t_open or fcntl), t_sndudata executes in asynchronous mode and fails under such conditions.

If t_sndudata is issued from an invalid state, or if the amount of data specified in udata exceeds the TSDU size as returned by t_open or t_getinfo, the provider generates an EPROTO protocol error. (See TSYSERR below.)

Return values

t_sndudata returns 0 on successful completion and -1 on failure, and t_errno is set to indicate the error.

Diagnostics

On failure, t_errno may be set to one of the following:

[TBADDATA]
Bad data was detected; XTI only.

[TBADF]
The specified file descriptor does not refer to a transport endpoint.

[TFLOW]
O_NONBLOCK was set, but the flow control mechanism prevented the transport provider from accepting data at this time.

[TLOOK]
A datagram error occurred on this transport endpoint; XTI only.

[TNOTSUPPORT]
The use of the T_CLTS service type is not supported by the underlying transport provider.

[TOUTSTATE]
The function was issued in the wrong sequence on the transport endpoint referenced by fd.

[TSYSERR]
A system error occurred during execution of this function. One possibility is a protocol error and is indicated by EPROTO being set in errno. Another possibility is an I/O error and is indicated by EIO being set in errno.

See also

Intro(NET), netbuf(FP), t_rcvudata(NET), t_rcvuderr(NET)

Standards conformance

t_sndudata is conformant with:

AT&T SVID Issue 3 ;
X/Open CAE Specification, Networking Services, Issue 4, 1994. ;
and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003