Functions and Directives

Function SocketPutMessage() Professional

Sends a message to a remote socket.

SocketPutMessage( <nSocket>  , ;
                  <nCommand> , ;
                  [<cMessage>] ) --> lSuccess
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.
A user-defined integer value must be passed for this parameter.
This is a character string representing the payload data of the message.

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


SocketPutMessage() is a "high-level" socket function that is used in conjunction with SocketGetMessage(). 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 is used to identify the type of the sent message, or to call an appropriate function in the remote process which analyzes the message data. The value of <nCommand> is user-defined.

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


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.