Sends a user-initiated disconnect request.
Transport Layer Interface Library (libtli.a)
The t_snddis subroutine is used to initiate an abortive release on an already established connection or to reject a connect request.
Item | Description |
---|---|
fd | Identifies the local transport endpoint of the connection. |
call | Specifies information associated with the abortive release.
The call parameter points to a t_call structure containing the following fields:
The values in the call parameter have different semantics, depending on the context of the call to the t_snddis subroutine. When rejecting a connect request, the call parameter must not be null and must contain a valid value in the sequence field to uniquely identify the rejected connect indication to the transport provider. The addr and opt fields of the call parameter are ignored. In all other cases, the call parameter 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 wish to send data to the remote user, the value of the call parameter can be null. The udata field 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 by the t_open or t_getinfo subroutine. If the len field of the udata field is 0, no data will be sent to the remote user. |
On successful completion, the t_snddis subroutine returns a value of 0. Otherwise, it returns a value of -1 and sets the t_errno variable to indicate the error.
If unsuccessful, the t_errno variable is set to one of the following:
Value | Description |
---|---|
TBADF | The specified file descriptor does not refer to a transport endpoint. |
TOUTSTATE | The error code is returned when the communication endpoint referenced by the file descriptor is not in a state in which a call to this function is valid. |
TBADDATA | The amount of user data specified was not within the bounds allowed by the transport provider. The transport provider's outgoing queue will be flushed, so data might be lost. |
TBADSEQ | An incorrect 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 might be lost. |
TLOOK | An asynchronous event has occurred on this transport endpoint and requires immediate attention. |
TNOTSUPPORT | This subroutine is not supported by the underlying transport provider. |
TSYSERR | A system error has occurred during execution of this subroutine. |