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?
| [reply] |
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).
| [reply] |
@salva thankyou very much, appreciate your patience.
| [reply] |