%SS2_ACCEPT

Accept a connection on a stream socket (IPv6)

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
status = %SS2_ACCEPT(socket, peer_socket[, in_port, in_addr6])

Return value

status

Returns SS_SUCCESS (0) or one of the errors in Error codes returned by %SS2_ACCEPT below. (n)

Arguments

socket

Socket created by %SS_SOCKET, bound to an address with %SS2_BIND, and that has successfully issued a call to %SS_LISTEN. (i4)

peer_socket

Returned with the peer socket descriptor. (i4)

in_port

(optional) Returned with the internet port of the connecting entity. (i4)

in_addr6

(optional) Returned with the IPv6 address of the connecting entity. ([#]byte)

Note

If either in_port or in_addr6 is passed, they must both be passed.

Discussion

%SS2_ACCEPT accepts a connection on a stream socket and is used by stream socket server applications only.

%SS2_ACCEPT extracts the first connection on the pending queue, creates a new socket with the same properties as socket, and returns the new socket descriptor in peer_socket.

If the listen queue has no connection requests, %SS2_ACCEPT blocks until a connection is present.

Error codes returned by %SS2_ACCEPT

See the Socket Errors table for additional information about these errors.

SS_EBADF

SS_EINTR

SS_EINVAL

SS_EMFILE

SS_ENETDOWN

SS_ENFILE

SS_ENOBUFS

SS_ENOMEM

SS_ENOTSOCK

SS_EOPNOTSUPP

SS_EUNKNOWN

SS_NOTINITIALISED