Indy 9
|
TIdRemoteCMDServer = class(TIdTCPServer)
TIdRemoteCMDServer provides a protected method that implements execution of a threaded client connection to the server. The default implementation handles validation of port numbers for the client connection, command execution and processing, and closing of the client connection. During execution, the client must provide a Null character (decimal 0) delimited list of arguments to the TIdRemoteCMDServer that includes:
When a port number for standard error output is provided, the executing client thread will create a TCP connection that will connect to the client's remote port number indicated in the initial argument to the remote command server. In RSH, this is done using a local port number in the range 512 through 1023. The standard error connection is closed after execution of the command for the threaded client connection.
Note: TIdRemoteCMDServer is the ancestor for more specialized server implementations like TIdRexecServer an TIdRshServer, and contains an protected abstract virtual method that must be overridden in descendant classes to invoke execution of the command for a threaded client connection.
procedure SendError(AThread: TIdPeerThread; AStdErr: TIdTCPClient; AMsg: String);
Use SendResult to return values that occur during successful execution of the command for the client connection.
procedure SendResults(AThread: TIdPeerThread; AStdErr: TIdTCPClient; AMsg: String);
Use SendError to return an error message that occurs during execution of the command for the client connection.