Listen for a connect indication.
X/Open Transport Interface Library (libxti.a)
#include <xti.h>
int t_listen (fd, call) int fd; struct t_call *call;
The t_listen subroutine listens for a connect request from a calling transport user.
By default, the t_listen subroutine executes in synchronous mode and waits for a connect indication to arrive before returning to the user. However, if O_NONBLOCK is set via the t_open subroutine or with the fcntl subroutine (F_SETFL), the t_listen subroutine executes asynchronously, reducing to a poll for existing connect indications. If none are available, the subroutine returns -1 and sets t_errno to TNODATA.
0 | Successful completion. |
-1 | t_errno is set to indicate an error. |
On failure, t_errno is set to one of the following:
TBADF | The specified file descriptor does not refer to a transport endpoint. |
TBADQLEN | The qlen parameter of the endpoint referenced by the fd parameter is zero. |
TBODATA | O_NONBLOCK was set, but no connect indications had been queued. |
TBUFOVFLW | The number of bytes allocated for an incoming parameter (maxlen) is greater than 0 but not sufficient to store the value of that parameter. The provider's state, as seen by the user, changes to T_INCON, and the connect indication information to be returned in the call parameter is discarded. The value of the sequence parameter returned can be used to do a t_snddis. |
TLOOK | An asynchronous event has occurred on the transport endpoint and requires immediate attention. |
TNOTSUPPORT | This subroutine is not supported by the underlying transport provider. |
TOUTSTATE | The subroutine was issued in the wrong sequence on the transport endpoint referenced by the fd parameter. |
TPROTO | This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno). |
TQFULL | The maximum number of outstanding indications has been reached for the endpoint referenced by the fd parameter. |
TSYSERR | A system error has occurred during execution of this subroutine. |
Some transport providers do not differentiate between a connect indication and the connection itself. If this is the case, a successful return of t_listen indicates an existing connection (see Appendix B, Internet Protocol-specific Information).
The fcntl subroutine, t_accept subroutine, t_alloc subroutine, t_bind subroutine, t_connect subroutine, t_open subroutine, t_optmgmt subroutine, t_rcvconnect subroutine.