t_sndudata.3 (2010 09)

t
t_sndudata(3) t_sndudata(3)
NAME
t_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;
DESCRIPTION
The 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 tran-
sport 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:
unsigned int maxlen maximum byte length of the data buffer
unsigned int len actual byte length of data written to buffer
char *buf points to buffer location
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 [TBA-
DADDR] and [TBADOPT], then these errors will alternatively be returned by
t_rcvuderr(). There-
fore, an application must be prepared to receive these errors both of these ways.
Fork Safety
t_sndudata is not fork-safe.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of 1 is returned and
t_errno
is set to indicate the error.
ERRORS
On failure,
t_errno is set to one of the following:
[TBADDATA] Illegal amount of data. Zero octets is not supported.
[TBADF] The specified file descriptor does not refer to a transport endpoint.
[TFLOW] Asynchronous mode is indicated because
O_NONBLOCK was set, but the transport
provider cannot accept the data because of flow-control restrictions.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)