@CHIP-RTOS C Library V2.00 - TCP/IP API
accept
Accept the next incoming connection. int accept ( int sd, struct sockaddr_in far *addressPtr,
int *error ); Parameters
sd
- Socket descriptor (must be switched into
listen mode using listen API).
addressPtr
- Optional output parameter: Pointer to a
sockaddr_in
structure
(see tcpipapi.h). On success, this function fills in
this sockaddr_in structure with the IP address and port number of
the accepted connection. This pointer can be set to NULL if
this address and port number report is not desired.
error
- Output parameter: Failure
code, 0 on success.
Return Value
- -1: Failure, error code output to error
else contains new socket descriptor for the connection.
Comments
- This API function extracts the first connection on the queue
of pending connections (client calls to
listen API). It then creates
a new socket for this connection. This new socket will have
the same socket options as the listening socket, sd
.
This call is used by a TCP server.
See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|