[Twisted-Python] Porting Apache Mina to Twisted
devnetwork at gmail.com
Mon Dec 6 16:00:44 MST 2010
Thank you for your response.
Probably that works and also itamar's approach seems right.
If connectionLost method is being called every disconnection (no
matter what reason is) my unregisterBySocket method handles that
situation already. I mean It s not possible to have disconnected
socket in my job pool(work).
On Mon, Dec 6, 2010 at 5:16 PM, Godson Gera <godson.g at gmail.com> wrote:
> On Mon, Dec 6, 2010 at 7:41 PM, Umut Aydin <devnetwork at gmail.com> wrote:
>> Hello again
>> I couldn't get any answer to my question and I think I couldn't point
>> my problem clearly.
>> 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
> 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
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
Email: me at umut.mobi
More information about the Twisted-Python