methodiSSHServerLogin.BeginLogin
procedure BeginLogin(aGraceTime: Cardinal);
Between BeginLogin and EndLogin a wait for the client's next message ends the connection (SSH_MSG_DISCONNECT reason 10) once aGraceTime milliseconds have passed since BeginLogin, and not before; with aGraceTime 0 it waits for as long as it takes. The wait for the client's version string ends then too, unless its own limit (30,000 tries) has ended it first. Outside the login, as on the client, a wait for the next message ends the connection after about 5 s without one.
During the login the connection belongs to the thread that logs the client in, which uses the transport without its lock, so Close then does not close it but cancels the login, as CancelLogin does. EndLogin ends the login; when it was cancelled, EndLogin ends the connection with SSH_MSG_DISCONNECT reason 11 and raises eSSHOutgoingDisconnect. After EndLogin, Close closes the connection again.