Back to product page

Connected callback


Called when wodSFTP connects to the remote server.

Syntax

  • C
void (*Connected)(void *Sftp, short ErrorCode, char *ErrorText);
The Connected(void *Sftp,short ErrorCode,char *ErrorText) syntax has these parts:
void *SftpHandle of the created Sftp instance.
short ErrorCodeError number, if an error occured.
char *ErrorTextText description of the error, if any.

Remarks

The Connected callback will always be called after the Connect method is issued. If wodSFTP successfully connected to the server, ErrorCode will be set to 0 and you can start sending/receiving data from the server. If ErrorCode is non-zero, then wodSFTP will immediately close the connection.

It is possible that wodSFTP will negotiate connection parameters internally , before the Connected callback is invoked. This is done to make wodSFTP as transparent to the protocol used as possible. You might notice packets being transmitted to/from server in the meantime, which means that wodSFTP is already connected but is still negotiating protocol parameters.

During this time, Extensions property will be also populated with list of extensions (if any), and version of SFTP protocol used on the server.

NOTE: this callback is called only if you have created an instance of the SftpEventsStruct structure, and set its Connected member to the function implementing it.

Platforms

Windows