ReceiveRequest Method  

Receive the request that was sent by the client to the server.


object.ReceiveRequest( ClientId, Buffer, [Length] )


An integer that identifies the client session.
A string variable or byte array that is passed by reference which will contain any request data submitted by the client.
An optional integer value that specifies the maximum amount of data returned by the method. If this parameter is omitted the entire request buffer will be returned. If a fixed length string or byte array is provided as the buffer, the maximum amount of data returned is limited by the size of the buffer.

Return Value

A value of zero is returned if the method completed successfully. Otherwise, a non-zero error code is returned which indicates the cause of the failure.


The ReceiveRequest method is called within an OnCommand event handler to process the command issued by the client and return information about the request to the server application. It is only necessary for the application to call this method if it wants to implement its own custom handling for a command.

It is recommended that you only use this method to process custom commands and not standard commands such as GET and POST. This ensures that the appropriate security checks are performed and the response conforms to the protocol standard. After the request data has been processed, the application should use the SendResponse or SendError method to send a response back to the client indicating success or failure.

This method may only be called once per command issued by the client.

See Also

SendError Method, SendResponse Method, OnCommand Event