[Twisted-Python] How do I get data from a Queue (or "outside") into a Telnet Server?

Mark Bailey mebly5343 at gmail.com
Tue Feb 2 10:45:28 EST 2010

Good day, Jean-Paul:

On Tue, Feb 2, 2010 at 8:47 AM, <exarkun at twistedmatrix.com> wrote:

> On 02:15 am, mebly5343 at gmail.com wrote:
> [...]

> What about this specifically are you having difficulty with?

Actually, what I was having trouble with was getting an instance of the
protocol class.  (The "instance" was from a
debugging line I forgot to take back out.) The FAQ entry does answer my
questions (which I didn't understand well
enough to ask clearly:-) ):

How do I get access to an instance of the protocol class?  (The answer is to
derive a class from Factory and use that to
store "self" from the protocol class.  The FAQ entry shows exactly how to do
this through the __init__ method - thanks.)

Thanks also for steering me away from complexities like threads and Queue.
callWhenRunning allows me to run in the context
of the reactor and access other Python objects, so that solves my problem.

I will probably end up using a socket for that connection and running the
server as a seperate process - but that is not the

> This isn't exactly wrong, but it's sort of misleading.  You've defined
> the name "instance" here, but it's not bound to an instance.  It's bound
> to the TelnetEcho class.
> [...]
> It's possible this FAQ entry will help:
> http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeinputononeconnectionresultinoutputonanother
> Jean-Paul

Thanks again for the very prompt and useful response.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100202/55d1d937/attachment-0001.htm 

More information about the Twisted-Python mailing list