Open Demayl opened 6 years ago
I hit a similar (same?) problem. In my case I tried to connect to a non existing IP and the connect
call seemed to hang indefinitely (>60 seconds). A look into the libssh sources reveals that the timeout
option is ignored on the ssh_connect
call when using non-blocking mode. This means that timeout handling has to happen client side, which currently doesn't happen.
@patrickbkr Does the merge of #17 mean this is resolved?
@jnthn That PR fixes my problem of hanging when the server is not reachable. I can't say for sure the problem @Demayl reported is actually the same.
This example hangs and eats 100% cpu when the connection times out in the OS. I think the problem is that event session must be removed after the timeout + ssh_free must be called in the CATCH phaser ( maybe teardown-session(), but then ssh_event_remove_session will fail with "Connection timeout" ). https://github.com/jnthn/p6-ssh-libssh/blob/926d72092eb9c9757f15f3095ecda45553193bc9/lib/SSH/LibSSH.pm6#L263-L274
Example: