#include <oskit/net/socket.h>oskit_error_t oskit_socket_accept(oskit_socket_t *s, [out] struct oskit_sockaddr *name, [in/out] oskit_size_t *anamelen, [out] struct oskit_socket **newopenso);
The accept method extracts the first connection request on the queue of pending connections, creates a new socket with the same properties of s and returns it. The socket must have been bound to an address with bind and it must be listening for connections after a listen.If no pending connections are present on the queue, accept blocks the caller until a connection is present.
- s
- The socket from which connections are to accepted.
- name
- Filled with the address of the connecting entity as known to the communication layer.
- anamelen
- Initially, the amount of space pointed to by name, on return it will contain the amount actually used.
- newopenso
- Newly created socket.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.