[Twisted-Python] Magical Disappearing Transport

Hi - 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. What causes the transport to be set to None? I feel like I'm missing something very basic, and I'm new to twisted, so I probably am. =) Thanks, Linden

On Mon, 8 Sep 2003 02:25:55 -0400 Linden Wright <lwright@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
participants (2)
-
Itamar Shtull-Trauring
-
Linden Wright