Back to FlowSsh Documentation

Client - Connect

[C]

void __cdecl FlowSshC_Client_Connect(
  FlowSshC_Client* client,
  FlowSshC_ProgressHandler handler,
  void* handlerData);

[C++]

[Client] void Connect(RefPtr<ProgressHandler> const& progress);

[C#]

[Client] public void Connect(ProgressHandler progress);

Parameters

  • [C] client: FlowSshC_Client pointer.
  • [C] handler: A ProgressHandler function to be used with the request. Optional.
  • [C] handlerData: An application-defined value to be passed to the handler. Optional.
     
  • [Cpp/Net] progress: A ProgressHandler object to be used with the request. Optional.

Remarks

Establishes an encrypted connection with the SSH server. Besides the progress handler, several other handlers might be invoked while the connection is being established. You should always register/implement at least the [Client]OnHostKey handler - without it, server (host-key) verification fails, and the connection is aborted. Usually, you will also want to implement an OnBanner, OnPasswordChange*, OnFurtherAuth*, or an OnSshVersion handler.

Connect will fail through its progress handler:

  • When called on an active client.
  • If an application name (and version) was not set.
  • If the client gets disconnected while connecting. In this case, the disconnect handler will not be called.

* In [C] the equivalent for OnPasswordChange and OnFurtherAuth is a user-auth handler, registered with SetUserAuthHandler.