Quantcast
Channel: Eltima Software – Knowledge Base
Viewing all articles
Browse latest Browse all 959

Asynchronous Commands

$
0
0

All the commands of the client’s application are invoked by the Development Kit library and are processed asynchronously on a different thread. This means that the library returns either an ID of the invoked command or an error to the client’s application upon calling of the corresponding function.

The command is processed for a certain period of time, after which either command is stopped when the timeout period elapses, or it completes successfully or with the error code. The client’s application can set the timeout for the command execution, or the Development Kit library can use the default timeout value which is different for various commands. Some of the commands are executed in a split second, some of them take some dozens of seconds to be completed.

The detailed result of the command execution is returned to the client’s application via the events queue. Refer to Result of Asynchronous Command Execution in API Reference.

In case the events queue is not allowed, the detailed result of the command execution is not available. However one can check whether the command is still in progress by calling FH_IsAsyncCommandWorking function.

Since the majority of commands change the computer’s and devices’ statuses to a certain extent, the info about the command execution is reflected in the corresponding data on the computer or device upon the successful command completeion.

The info about computers and devices is received through the central server, that’s why certain pauses (splits of a second) are possible when getting the updated info.

Common for All Commands

The names of all asynchronous commands contain Async suffix.

All the asynchronous commands accept timeoutMs parameter (timeout value in milliseconds) as the last argument. If timeoutMs is set to –1, the command will use the internal timeout value.

All the asynchronous commands return the ID of the invoked command (integer digit not equal to zero) or 0, in case the command cannot be executed due to some reason (wrong arguments or the system status).

The command ID can be used for periodical polling to know whether the command is still being processed or whether it has already been completed.

The final result of the command execution is sent as an event through the events queue.

Refer to the “JSON Events:Result of Asynchronous Command Execution” chapter to read about JSON format of the object-event with result of command execution.

The possible error codes in the returned result are described in the context of each command.

  • FH_IsAsyncCommandWorking

Login computer into account:

  • FH_LoginComputerAsync
  • FH_ResetAllComputersAsync
  • Managing Computers in Account
  • FH_SetComputerNameAsync
  • FH_LogoutComputerAsync

Managing Local Devices:

  • FH_SetDeviceDescriptionAsync
  • FH_LockDeviceAsync

Managing Devices from Other Computers:

  • FH_ConnectDeviceAsync
  • FH_DisconnectDeviceAsync
  • FH_ForgetConnectionAsync
  • FH_ChangeExistingConnectionParametersAsync
  • FH_SetComportNameAsync

Viewing all articles
Browse latest Browse all 959

Trending Articles