[Twisted-Python] Magical Disappearing Transport
Itamar Shtull-Trauring
itamar at itamarst.org
Fri Sep 12 22:15:30 EDT 2003
On Mon, 8 Sep 2003 02:25:55 -0400
Linden Wright <lwright at mac.com> wrote:
> I have a client factory and protocol written for TCP connections, and
> whenever I try to transport.write(), it tells me that the transport ==
>
> None. The only time that I can successfully transport.write() is in my
>
> protocol's connectionMade method. My protocol inherits from
> protocol.Protocol, my factory inherits from protocol.ClientFactory,
> and otherwise, my code pretty much follows the examples.
You are probably trying to call it in __init__, when obviously it can't
exist since the transport hasn't had time to be connected to the
protocol yet. You should only call it in connectionMade, dataReceived
and any methods they call.
--
Itamar Shtull-Trauring http://itamarst.org/
Available for Python & Twisted consulting
More information about the Twisted-Python
mailing list