United States-English |
|
|
HP-UX Reference > Tt_sndudata(3)HP-UX 11i Version 3: February 2007 |
|
NAMEt_sndudata() — send a data unit SYNOPSIS#include <xti.h> /* for X/OPEN Transport Interface - XTI */ /* or */ #include <tiuser.h> /* for Transport Layer Interface - TLI )" int t_sndudata(fd, unitdata); int fd; struct t_unitdata *unitdata; DESCRIPTIONThe t_sndudata() function is used in connectionless mode to send a data unit to another transport user. The argument fd identifies the local transport endpoint through which data is sent. The argument unitdata points to a type t_unitdata structure used to specify a data unit being sent through the transport endpoint specified by the fd parameter. The t_unitdata structure has the following members: struct netbuf addr; struct netbuf opt; struct netbuf udata; The type netbuf structure is defined in the <xti.h> or <tiuser.h> header file. This structure, which is used to define buffer parameters, has the following members:
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, and sending of zero octets is not supported by the underlying transport service, the t_sndudata() will return -1 with t_errno set to [TBADDATA]. By default, t_sndudata() executes in the synchronous operating 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() will execute in asynchronous mode and will fail under such conditions. The process can arrange to be notified of the clearance restriction via either t_look() or the EM interface. If the amount of data specified in udata exceeds the TSDU size as returned in the tsdu field of the info argument of t_open() or t_getinfo(), a [TBADDATA] error will be generated. If t_sndudata() is called before the destination user has activated its transport endpoint, the data unit may be discarded. If it is not possible for the transport provider to immediately detect the conditions that cause errors [TBADADDR] and [TBADOPT], then these errors will alternatively be returned by t_rcvuderr(). Therefore, an application must be prepared to receive these errors both of these ways. RETURN VALUEUpon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate the error. ERRORSOn failure, t_errno is set to one of the following:
|
Printable version | ||
|