Home |
Function net_accept |
Function net_acceptAccepts a TCP connection from any remote host in non-blocking mode. SOCKET net_accept(SOCKET socket, int Seconds); ParameterssocketSocket returned by net_socket or socket, bound by net_bind or bind and previously placed in listen state by net_listen or listen. SecondsTimeout in seconds. This parameter is ignored if zero, which means the operation waits indefinitely for sockets in blocking mode or returns immediately for sockets in non-blocking mode. Value RTIP_INF will wait indefinitely. return valueReturns a newly allocated socket in non blocking mode assigned to this connection if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Error Codes further describes each error. This function calls function accept and net_set_non_blocking internally. For secure sockets, a socket in secure mode is returned and an encryption context is allocated from the master socket and initialized and the encryption method is negociated.
|