Retrieves information from disconnect.
Transport Layer Interface Library (libtli.a)
The t_rcvdis subroutine is used to identify the cause of a disconnect, and to retrieve any user data sent with the disconnect.
Item | Description |
---|---|
fd | Identifies the local transport end point where the connection existed. |
discon | Points to a t_discon structure that contains the reason
for the disconnect and contains any user data that was sent with the
disconnect. The t_discon structure contains the following members:
These fields are defined as follows:
If a user does not care if there is incoming data and does not need to know the value of the reason or sequence fields, the discon parameter may be null and any user data associated with the disconnect will be discarded. However, if a user has retrieved more than one outstanding connect indication (using the t_listen subroutine) and the discon parameter is null, the user will be unable to identify with which connect indication the disconnect is associated. |
On successful completion, the t_rcvdis 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 may be set to one of the following:
Value | Description |
---|---|
TBADF | The specified file descriptor does not refer to a transport end point. |
TBUFOVFLW | The number of bytes allocated for incoming data is not sufficient to store the data. (The state of the provider, as seen by the user, will change to T_IDLE, and the disconnect indication information to be returned in the discon parameter will be discarded.) |
TLOOK | An asynchronous event has occurred on this transport endpoint and requires immediate attention. |
TNODIS | No disconnect indication currently exists on the specified transport end point. |
TNOTSUPPORT | This function is not supported by the underlying transport provider. |
TOUTSTATE | This subroutine was issued in the wrong sequence. |
TSYSERR | A system error has occurred during execution of this subroutine. |