On Mon, Dec 6, 2010 at 7:41 PM, Umut Aydin <devnetw...@gmail.com> wrote:
> Hello again > > I couldn't get any answer to my question and I think I couldn't point > my problem clearly. > > https://github.com/naimon/Jobbar/blob/master/src/lib/server.py > > On the line #130 I need to check if the socket is still connected. > > That worker variable is a copy of self.transport actually. I have > found it's an instance of twisted.internet.tcp.Server > I also found getHandle method to reach the actual socket but I > couldn't find any method to check its availability. > Store a reference to the protocol object it self instead of protcol's transport. Connectiong checking can be done easily by simply adding a state attribute to your protocol class. In your protocol define self.isConnected = False . Set that attribute to True inside connectionMade() event method and set that to False inside connectionLost() event. -- Thanks & Regards, Godson Gera. Twisted Python Consultant India<http://blog.godson.in/2008/10/starpy-100a13-released-asterisk.html>
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python