Initialization and Error Handlers
void __cdecl FlowSshC_Initialize(FlowSshC_ErrorHandler handler, void* handlerData);
[SshNet] public static event ExceptionInEventEventHandler OnExceptionInEvent;
Methods and Parameters
You should always initialize the FlowSshC/Cpp/Net library and register a global error handler before using any of its functionality. Once using the library, there are two possible kinds of errors:
InCall errors. Any FlowSshC/Cpp/Net call may fail. For instance, imagine the [Client]SetUserName operation fails. Then we say that an InCall error occurred and:
InHandler errors. Handlers are mostly invoked from internal FlowSshC worker threads. The consequence is that special treatment (at least for [Cpp/Net]) is required for exceptions that get thrown by handlers. For instance, imagine that your [Client]OnHostKey handler throws an exception. Then we say that an InHandler error occurred and:
[C] FlowSshC_Initialize may be called multiple times for the purpose of changing the error handler. Calling the function multiple times has no other effects - shutdown will always be performed with the first call to FlowSshC_Shutdown.
[Cpp] Before using any FlowSshCpp functionality, create a single instance of Initializer (i.e. at the beginning of your main function). Don't create a global instance of this class.
[Net] Before using any FlowSshNet functionality, register to the OnExceptionInEvent event. You may register multiple delegates - this has no side-effects as OnExceptionInEvent is an ordinary .NET event.