methodTstCustomSSHClient.ConnectToHost
procedure ConnectToHost;
Step 1 of the connect sequence: opens the transport socket and runs the SSH version exchange plus key exchange (host-key verification, cipher/MAC/kex negotiation from the option lists). Call this first, then Login, then CreateChannel. Raises if key exchange fails; the server host key is verified against ServerKeyOptions / the pinned ServerXxxKey and can be gated via OnSetKey. Client-side call (the server side accepts instead). Until it returns, the connection is this thread's: a Close from another thread cancels it (see Close), and this thread then sends SSH_MSG_DISCONNECT reason 11 and closes the connection the next time it reads or sends - at once while it waits for the server, otherwise when the step under way, an OnSetKey handler say, is done - and ConnectToHost raises: eSSHOutgoingDisconnect, or what that step raised. A Close while the TCP connection is being made (SocketClient.Open, OnRawConnect) closes it with nothing sent, not even the version string, as soon as the connect is over. On Windows the connect itself is not cut short: to a host that does not answer, ConnectToHost goes on until the system gives up on it - tens of seconds with its default settings - and then raises the connect's own error. On the other platforms the wait for the connect ends at once.