%SS_ACCEPT
Accept a connection on a stream socket (IPv4)
WSupported on Windows
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
status = %SS_ACCEPT(socket, peer_socket[, in_port, in_addr])
Return value
status
Returns SS_SUCCESS (0) or one of the errors in Error codes returned by %SS_ACCEPT below. (n)
Arguments
socket
Socket created by %SS_SOCKET, bound to an address with %SS_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_addr
(optional) Returned with the IPv4 address of the connecting entity. (i4)
If either in_port or in_addr is passed, they must both be passed. |
Discussion
%SS_ACCEPT accepts a connection on a stream socket and is used by stream socket server applications only.
%SS_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, %SS_ACCEPT blocks until a connection is present.
Error codes returned by %SS_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