wodSFTP API library - Connected Callback
    
 

Description

Called when wodSFTP connects to the remote server.


Syntax

void (*Connected)(void *Sftp, short ErrorCode, char *ErrorText);

The Connected Event syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
short ErrorCode Error number, if an error occured.
char *ErrorText Text 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.