|
Description
The user calls the t_look() function to get the current event on the transport endpoint specified by the fd parameter.
t_look() allows the transport provider to report an asynchronous event to the user if the user executes functions in synchronous mode. Some events must be reported immediately to the user and are indicated by a special error code (TLOOK) when the current or next function is executed.
The user can call t_look() to periodically poll a transport endpoint for asynchronous events (poll()).
Return value
If execution is successful, t_look() returns a value which indicates the event that occurred.t_look() returns the value 0 if no events occurred.
If an error occurs, -1 is returned and t_errno is set to indicate the error.
The following events can be returned by t_look():
T_LISTEN
Indication of a connection was received.
T_CONNECT
Confirmation of a connection was received.
T_DATA
Data was received.
T_DISCONNECT
Indication of a connection shutdown was received.
T_UDERR
Indication of a datagram error was received.
T_ORDREL
Indication of an orderly connection shutdown was received.
Errors
TBADF
The specified file descriptor does not reference a transport endpoint.
TSYSERR
A system error occurred during execution of this function.