Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^10: SSH to remote subsystem (Net::OpenSSH?)

by salva (Canon)
on Sep 10, 2014 at 15:22 UTC ( [id://1100167]=note: print w/replies, xml ) Need Help??


in reply to Re^9: SSH to remote subsystem (Net::OpenSSH?)
in thread SSH to remote subsystem (Net::OpenSSH?)

The returned $out is a regular file handle. You can just set it in autoflushing mode using $out->autoflush(1).

Replies are listed 'Best First'.
Re^11: SSH to remote subsystem (Net::OpenSSH?)
by alrighttheresham (Initiate) on Sep 10, 2014 at 18:54 UTC
    Thanks but unfortunately setting autoflush didnt work. As mentioned previously the close on the $out resulted in the incoming message being printed.

    Can you help me understand why closing one file handle ($out) results in the other file handle ($in) printing output in the while loop?

    Are the file handles tied, is closing one in effect closing the other?

      Can you help me understand why closing one file handle ($out) results in the other file handle ($in) printing output in the while loop?

      When you close the $out file handle, the remote process which is reading from the other side gets an EOF and that triggers its 'ok-i-have-the-complete-request-sending-the-response-now' logic.

      In theory, sending the end of record marker should be enough to get the response back, but it is not uncommon for network equipment to have broken SSH implementations. In this case, it seems that it has some buffering issue.

      Delivering of the EOF in SSH is done using a different set of protocol primitives and those are correctly flushing the buffers (otherwise, it would be a useless SSH implementation).

        @salva thankyou very much, appreciate your patience.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found