[Twisted-Python] how to get extReceived call from SSHCommandClientEndpoint

Jean-Paul Calderone exarkun at twistedmatrix.com
Fri Apr 5 12:12:54 MDT 2019


On Fri, Apr 5, 2019 at 2:08 PM Sereysethy TOUCH <touch.sereysethy at gmail.com>
wrote:

> Hi Sean,
>
> Yes it is a method of SSHChannel, but when I read the source code, the
> _CommandChannel only implements dataReceived which calls protocol's method
> but it does not implement extReceived.
>
> When you suggest to call it like that (self.transport.conn.channels[0].extReceived()),
> how do I know when extended data is received?
>
> For now I have subclassed _CommandChannel and also SSHCommandClientEndpoint
> in order to add extReceived.
>

An interesting question might be ... what do you want to happen to such
data?  Do you want it mixed in with the stdout stream?

For an IProtocol-based API, there aren't a lot of other options.  Maybe it
would be useful to have a similar API that works in terms of
IProcessProtocol instead of IProtocol?

There is a ProcessEndpoint that takes a flag that controls what it does
with stderr - currently supporting only two options, log it or drop it.

What did you hook extReceived up to in your subclass?

Jean-Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20190405/b3c25168/attachment-0002.html>


More information about the Twisted-Python mailing list