ADSSession class
The ConnectRemote method authenticates the client and establishes a session with the Arcana Scheduler service running on a remote computer.
C++ |
hr=session->ConnectRemote(BSTR serverName,BSTR password) |
VB |
session.ConnectRemote(BSTR serverName,BSTR password) |
serverName |
The name of the remote computer to connect to. |
password |
An optional password. The password may or may not be required, depending on the security setup for the Scheduler service to which you are attempting to connect. Look for "security" in the Arcana Scheduler help index for more information on authentication. |
The following error codes are commonly encountered with this method. See the Error Codes topic for additional error-handling information.
ADS_PASSWORD_REQUIRED |
A password is required to connect to the Scheduler service. |
ADS_E_SERVICE_NOT_RUNNING |
The Arcana Scheduler service is not running. Use the StartService method to start it, then retry the connection. |
ADS_E_VERSION_MISMATCH |
The version of the Arcana Scheduler running on the server is different from the version being used by the client. |
ADS_E_INVALID_PASSWORD |
The specified password is invalid. |
The ConnectRemote method provides an alternative to the Connect method when connecting to a remote computer, and provides better performance over slow networks.
To use the Connect method to connect to a remote server, you must create an instance of the ADSSession object on that computer (using DCOM). Because the ADSCom objects use standard marshalling, each method or property call requires that data be sent across the network.
When you use the ConnectRemote method you first create the ADSSession object on the local (client) computer. ConnectRemote then communicates with the remote server using a named pipe connection (the same mechanism that the Schedule Administrator uses to communicate with the service). Using this mechanism all configuration data is transferred from the server to the client when you call ConnectRemote. Method and property calls thus operate on local copies of the data, not requiring a trip across the network. This locally-buffered data is sent back to the server when you call the session's Save method and is refreshed when you call the Refresh method.
Once you have connected using ConnectRemote all methods and properties work exactly as they do when you call the Connect method.