paramikojs icon indicating copy to clipboard operation
paramikojs copied to clipboard

Pull socket inside of transport

Open kousu opened this issue 9 years ago • 1 comments

This is a feature request.

I find it awkward that I need to create my real transport (cough_WebSockets_cough) outside of paramikojs and pass in a writeCallback to do writes and need to manually edit transport.fullBuffer to make reads work. Paramiko-python doesn't need this because it can use threads. However, in lieu of threads, setInterval() could be used on transport.run() to handle reads and instead of passing writeCallback, transport could be an base class with abstract read() and write() methods. This change would make it easier to integrate websockets as I would just write a subclass of transport.

I sort of like the idea of exposing the event processor (transport.run())--it fits nicely with my twisted/asyncio/SDL training--so I'm not entirely sold on secretly using setInterval()... but if original Paramiko does secret threads, maybe it's the quickest and most reliable choice.


Sort of relatedly, it's annoying that I need to poll (recv +WaitException ~= select(..., 0)) to get data out of a paramikojs shell session. I would rather set an event listener to be called when data comes in.

kousu avatar Sep 23 '14 05:09 kousu

Indeed, great feedback and comments. I'll keep this in mind as the project moves forward. (patches also welcome of course from anybody listening)

mimecuvalo avatar Sep 25 '14 23:09 mimecuvalo