<br><br><div class="gmail_quote">On Mon, Dec 6, 2010 at 7:41 PM, Umut Aydin <span dir="ltr">&lt;<a href="mailto:devnetwork@gmail.com">devnetwork@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello again<br>
<br>
I couldn&#39;t get any answer to my question and I think I couldn&#39;t point<br>
my problem clearly.<br>
<br>
<a href="https://github.com/naimon/Jobbar/blob/master/src/lib/server.py" target="_blank">https://github.com/naimon/Jobbar/blob/master/src/lib/server.py</a><br>
<br>
On the line #130 I need to check if the socket is still connected.<br>
<br>
That worker variable is a copy of self.transport actually. I have<br>
found it&#39;s an instance of twisted.internet.tcp.Server<br>
I also found getHandle method to reach the actual socket but I<br>
couldn&#39;t find any method to check its availability.<br>
</blockquote><div><br><br>Store a reference to the protocol object it self instead of protcol&#39;s transport. <br> <br>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. <br>
<br><br>-- <br></div></div>Thanks &amp; Regards,<br>Godson Gera.<br><a href="http://blog.godson.in/2008/10/starpy-100a13-released-asterisk.html">Twisted Python Consultant India</a><br><br>