t_snddis() — Send user-initiated disconnect request

Standards

Standards / Extensions C or C++ Dependencies
XPG4.2 both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <xti.h>

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

General description

Initiates an abortive release on an already established connection, or rejects a connect request. The argument fd identifies the local transport endpoint of the connection, and call specifies information associated with the abortive release. The argument call points to a t_call structure which contains the following members:
        struct netbuf   addr;
        struct netbuf   opt;
        struct netbuf   udata;
        int             sequence;
The values in call have different semantics, depending on the context of the call to t_snddis() . When rejecting a connect request, call must be non-NULL and contain a valid value of sequence to uniquely identify the rejected connect indication to the transport provider. The sequence field is only meaningful if the transport connection is in the T_INCON state. The addr and opt fields of call are ignored. In all other cases, call should be a NULL pointer, since its only use would be to specify user data to be passed on the disconnect request, which is not supported by the TCP transport provider.

t_snddis() is an abortive disconnect. Therefore a t_snddis() issued on a connection endpoint may cause data previously sent using t_snd(), or data not yet received, to be lost (even if an error is returned).

Because of implementation restrictions, a t_snddis() called on one descriptor referring to an endpoint will not affect descriptors in other processes referring to the same endpoint. If descriptors in multiple processes refer to the same endpoint, the endpoint will not actually be disconnected by a t_snddis in one process. Multiple processes cooperating on an endpoint are responsible for providing their own explicit synchronization to support coordinated disconnects.

Valid states: T_DATAXFER,T_OUTCON,T_INCON(ocnt > 0)

Returned value

If successful, t_snddis() returns 0.

If unsuccessful, t_snddis() returns -1 and sets errno to one of the following values:
Error Code
Description
TBADDATA
The amount of user data specified was not within the bounds allowed by the transport provider.
TBADF
The specified file descriptor does not refer to a transport endpoint.
TBADSEQ
An invalid sequence number was specified, or a NULL call pointer was specified, when rejecting a connect request.
TLOOK
An asynchronous event, which requires attention, has occurred.
TNOTSUPPORT
This function is not supported by the underlying transport provider.
TOUTSTATE
The function was issued in the wrong sequence on the transport endpoint referenced by fd.
TPROTO
This error indicates that a communication problem has been detected between XTI and the transport provider for which there is no other suitable XTI (t_errno).
TSYSERR
A system error has occurred during execution of this function.

Related information