Topic Path: Symbol Reference > Classes > TIdRemoteCMDServer Class
ContentsIndexHome
PreviousUpNext
TIdRemoteCMDServer Class

Implements a common ancestor for a multithreaded server that executes a command for a remote client connection.

File
TIdRemoteCMDServer = class(TIdCustomTCPServer);

TIdRemoteCMDServer is a TIdTCPServer descendant that implements a multithreaded server that accepts remote client connections in order to execute commands. 

TIdRemoteCMDServer implements event handlers that allow execution of the client connection contexts, and generation of result or error messages for the remote client. 

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: 

  • Client port number for standard error output. The default value is 0 when standard error output is not used for the connection.
 

  • User name for use in authenticating the client connection in the Rexec protocol or the User ID on the client machine in the RSH protocol.
 

  • Password for use in authenticating the client connection in the Rexec protocol or the User ID on the host machine in the RSH protocol.
 

  • Command line and optional arguments to be executed by the server.
 

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. 

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.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.