Function SocketGetMessage() Professional

Retrieves a message from a socket.

Syntax
SocketGetMessage( <nSocket>  , ;
                  @<nCommand>, ;
                  @<cMessage>  ) --> lSuccess
Parameters
<nSocket>
This is a numeric socket descriptor identifying a socket of type SOCK_STREAM. Datagram sockets and sockets in non-blocking mode cannot be used with this function.
<nCommand>
If this parameter is passed by reference, it gets assigned the numeric <nCommand> value specified with SocketPutMessage().
<cMessage>
This parameter must be passed by reference. It gets assigned the value of <cMessage> specified with SocketPutMessage().
Return

The function returns .T. (true) if the message is received successfully, otherwise .F. (false) is returned.

Description

SocketGetMessage() is a "high-level" socket function that is used in conjunction with SocketPutMessage(). Both functions process a combination of a numeric value <nCommand> and a message string <cMessage>which represents the payload data of a message. The <nCommand> parameter can then be used to identify a function to process received data. The value of <nCommand> is user-defined.

For security reasons, the function SocketGetMessage() cannot handle messages larger than 128 MB. The function returns the value .F. (false) in this case. This restriction was increased from 32MB to 128MB with Xbase++ version 2.00.2196.

Do not mix SocketPutMessage()/SocketGetMessage() calls with SocketSend()/SocketRecv().

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.