Back to product page

StateChange callback


Called when wodSFTP changes its state.

Syntax

  • C
void (*StateChange)(void *Sftp, long OldState);
The StateChange(void *Sftp,long OldState) syntax has these parts:
void *SftpHandle of the created Sftp instance.
long OldStateA StatesEnum enumeration, as described in settings. Holds the previous state.

Remarks

The settings for OldState are:

Constant Value Description
Disconnected0 Disconnected from server.
Connecting 1 Connecting to server.
LogonInProgress2 Sending authentication data.
Connected 3 Connected to server - idle.
Receiving4 Receiving data from server.
Sending 5 Receiving data from server.
Executing6 Executing command on server.


The StateChange callback is invoked each time wodSFTP's internal state changes. Initially, it is set to Disconnected. Once you initiate a new connection, it will change to Connecting, etc.. Using this callback you can see if there is something happening with wodSFTP or if it is idle and waiting for your commands. You can determine the current state using State function. NOTE: this callback is called only if you have created instance of SftpEventsStruct structure, and set up its StateChange member to function implementing it.

Platforms

Windows