Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: SSH2 - Asynchronous Opens & Synchronous Commands

by salva (Monsignor)
on Apr 05, 2014 at 08:40 UTC ( #1081223=note: print w/ replies, xml ) Need Help??


in reply to SSH2 - Asynchronous Opens & Synchronous Commands

libssh2 can do the SSH handshaking and user authentication stages in non-blocking mode. I am not completely sure the same can be currently done with Net::SSH2 though.

The trick would be to call $ssh2->blocking(0) just after creating the Net::SSH2 object and then calling connect and auth_* while checking for LIBSSH2_ERROR_EAGAIN errors and then using the select function to wait for data to arrive at some of the underlaying sockets.

I have done something similar for the Net::SSH2 backend of my module Net::SSH::Any and would have to say that it is going to be a difficult task and would probably require fixing bugs in Net::SSH2 (in that case, report them through GitHub, I would be looking and could help).


Comment on Re: SSH2 - Asynchronous Opens & Synchronous Commands
Select or Download Code
Re^2: SSH2 - Asynchronous Opens & Synchronous Commands
by 5haun (Acolyte) on Apr 05, 2014 at 15:05 UTC
    Hhmmm. Ok. I'll give it a try...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1081223]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-09-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (144 votes), past polls