t_snddis(3xti)


t_snddis -- send user-initiated disconnect request

Synopsis

cc [options] file -lnsl
#include <xti.h>

int t_snddis(int fd, struct t_call *call):

Description

This function is a TLI/XTI connection release routine used to initiate a release on an already established connection with a responding transport endpoint, specified by fd. It may also be issued to reject a connect request.

The values pointed to by call have different semantics that vary with the context of the call.

This function is a service of connection-mode transport providers and is supported only if the provider returned service type T_COTS or T_COTS_ORD on t_open or t_getinfo.

Parameters


fd
the file descriptor for the transport endpoint where the connection exits.

call
points to the t_call structure associated with information about the connection.

Structure definitions

The call argument points to a t_call structure that contains the following members:
   struct netbuf addr;	/* address	*/
   struct netbuf opt;	/* options	*/
   struct netbuf udata;	/* user data	*/
   int sequence;	/* sequence number	*/
netbuf is described in intro(3xti).

When rejecting a connect request, call must be non-NULL and contain a valid value of sequence to identify uniquely the rejected connect indication to the transport provider. The addr and opt fields of call are ignored.

In all other cases, call need only be used when data is being sent with the disconnect request. The addr, opt, and sequence fields of the t_call structure are ignored. If the user does not want to send data to the remote user, the value of call may be NULL.

udata specifies the user data to be sent to the remote user. The amount of user data must not exceed the limits supported by the transport provider as returned in the discon field of the info argument of t_open or t_getinfo. If the len field of udata is zero, no data will be sent to the remote user.

State transitions

t_snddis may be issued from any valid state except T_UNINIT, T_UNBND, or T_IDLE. Valid states on exit are T_IDLE (successful) and T_INCON (successful but there are connect indications outstanding).

Files


/usr/lib/libxti.so
X/Open® Transport Interface Library (shared object)

/usr/lib/libnsl.so
Network Services Library (shared object)

Usage

After issuing t_snddis, the user may not send any more data over the connection. However, a user may continue to receive data if a disconnect request has not been received (see t_rcvdis).

Return values

t_snddis returns 0 on success and -1 on failure and t_errno is set to indicate the error.

Errors

On failure, t_errno may be 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. The transport provider's outgoing queue may be flushed, so data may be lost.

TBADDATA
The amount of user data specified was not within the bounds supported by the transport provider as returned in the discon field of the info argument of t_open or t_getinfo. The transport provider's outgoing queue will be flushed, so data may be lost.

TBADSEQ
An invalid sequence number was specified, or a NULL call structure was specified when rejecting a connect request. The transport provider's outgoing queue will be flushed, so data may be lost.

TLOOK
An asynchronous event has occurred on the transport endpoint specified by fd and requires immediate attention.

TNOTSUPPORT
This function is not supported by the underlying transport provider.

TSYSERR
A system error has occurred during execution of this function.

TPROTO
A communication problem has been detected with the transport provider and there is no other value of t_errno to describe the error condition.

Warnings

When executed, t_snddis causes an abortive disconnect, which may result in a loss of data sent by t_snd but not yet received. The return of an error does not preclude loss of data.

References

intro(3xti), t_connect(3xti), t_getinfo(3xti), t_listen(3xti), t_open(3xti), t_rcvdis(3xti), t_rcvrel(3xti), t_snd(3xti), t_sndrel(3xti)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004