NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libtelnetd.a #include <arpa/telnetd.h>int inetAccept(inetSocket * sockets, int count, int * connectionSocket, int * connectionPort);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The inetClient() function waits for a new INET connection. It has the following arguments:
sockets -- This is an array of count inetSocket data structures describing sockets previously created and bound to IP ports by inetBind .
connectionSocket -- This result parameter is filled with the file descriptor of the new socket created for the new INET connection.
connectionPort -- This result parameter is filled with the IP port number on which the client initiated the connection.
The telnetdInit() function can be invoked later on connectionSocket to initialize a TELNET session. This session can be controlled by other functions of the TELNETD library, such as telnetdUser() , telnetdRead() or telnetdSetTermState() .
The application may also manage the new connection directly, using the low level POSIX socket API. In particular, it can close the socket if it elects to reject the connection (see close(2POSIX) ), or it can read all data received on the connection, including TELNET commands (see read(2POSIX) ).
The inetClient() function fills the clientInAddr argument with the Internet address of the TELNET client connected to the connectionSocket socket.
On successful completion, inetAccept() returns a value of zero. Otherwise it returns -1 and sets errno to indicate the error.
errno is set to EINVAL if one of the socket members of the inetSocket data structures is still initialized to TD_INVALID_SOCKET .
inetAccept() may also fail and set errno to any of the errors specified for the accept(2POSIX) and select(2POSIX) functions.
inetClient() can fail and set errno to any of the errors specified for the getpeername(2POSIX) function.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO