Execute the specified command on the remote host.
An integer value which specifies the port number to connect to. This method may be used to either connect to the rexec service or the rshell service, and which service is selected depends on the port number provided. One of the following values should be used:
Port | Description |
---|---|
rshPortExec | A connection is established with the server using port 512, the rexec service. This service requires that the client provide a username and password to execute the specified command. |
rshPortShell | A connection is established with the server using port 514, the rshell service. This service uses host equivalence to authenticate the user. With host equivalence, the remote server considers the client to be equivalent to itself, and as long as the specified user exists on the remote host, the client is permitted to execute commands on behalf of the user without requiring a password. Host equivalence is configured by the server administrator. |
A boolean value which specifies if the connection has been established. If the socket is in blocking mode, a return value of true indicates that the connection has completed and the application may send and receive data from the remote host. If the client is in non-blocking mode, a return value of true indicates that the socket has been successfully created and the connection is in progress.
When a non-blocking connection has completed, the OnConnect event will be fired. If this method returns false, the connection could not be established and the application should check the value of the LastError property to determine the cause of the failure.
The Execute method executes the specified command on a remote host. Output from the command may be read using the Read method. Input can be supplied to the program using the Write method. To search for a specific sequence of bytes in the output returned by the server, use the Search method.
The value of the Timeout property specifies the timeout period. The value of the Options property specifies the options that will be used when establishing the connection.
RshClient Class | SocketTools Namespace | RshClient.Execute Overload List