SocketTools .NET Edition

PopClient.Command Method (String, Boolean)

Send a custom command to the server.

[Visual Basic]
Overloads Public Function Command( _
   ByVal command As String, _
   ByVal isMultiLine As Boolean _
) As Boolean
[C#]
public bool Command(
   string command,
   bool isMultiLine
);

Parameters

command
A string which specifies the command to send. Valid commands vary based on the Internet protocol and the type of server that the client is connected to. Consult the protocol standard and/or the technical reference documentation for the server to determine what commands may be issued by a client application.
isMultiLine
A boolean value which specifies if the command will result in multiple lines of output from the server. For more information about a specific command, consult the standards documentation for the protocol.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The Command method sends a command to the remote host and processes the result code sent back in response to that command. This method can be used to send custom commands to a server to take advantage of features or capabilities that may not be supported internally by the class library.

The isMultiLine parameter is used by the method to determine if multiple lines of data will be returned by the server as the result of a command. Unlike a single line response, which consists of a result code and result string, a multi-line response consists of one or more lines of text, terminated by a special end-of-data marker.

To determine the specific status code returned by the server, check the value of the ResultCode property after the method returns.

See Also