%SS_RECV

Receive bytes from a socket

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
status = %SS_RECV(socket, buf, bytes_received[, SS_MSG_PEEK])

Return value

status

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

Arguments

socket

A descriptor of an open socket created by %SS_SOCKET. (i4)

buf

Buffer returned with the incoming data. (a)

bytes_received

Returned with the number of bytes received and placed into buf. (i4)

SS_MSG_PEEK

(optional) Peek into the data that is next in line to be received without removing it from the system’s buffers. (n)

Discussion

%SS_RECV reads incoming data from a connected stream socket or from a datagram socket with an established peer address. (To receive data from a datagram socket without an established peer address, use %SS_RECVFROM.)

Unlike %SS_RECVBUF, however, you can pass the SS_MSG_PEEK flag to %SS_RECV to peek into the data to be received without actually removing that data from the system’s buffers.

If no incoming data is available at the socket, %SS_RECV blocks until data arrives.

Error codes returned by %SS_RECV

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

SS_EBADF

SS_ECONNABORTED

SS_ECONNRESET

SS_EINTR

SS_EINVAL

SS_EMSGSIZE

SS_ENETDOWN

SS_ENOBUFS

SS_ENOTCONN

SS_ENOTSOCK

SS_EUNKNOWN

SS_NOTINITIALISED