Re: how to get extReceived call from SSHCommandClientEndpoint

Jean-Paul Calderone <[email protected]> Fri, 5 Apr 2019 14:12:54 -0400
Newsgroups gmane.comp.python.twisted
Message-ID <CAEeXt4Og3SsdMew_Qat81aor8J7384ZjAHr86682upQBqP+f6A@mail.gmail.com>
On Fri, Apr 5, 2019 at 2:08 PM Sereysethy TOUCH <[email protected]>
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

_______________________________________________
Twisted-Python mailing list
[email protected]
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python