Hi,

Ok assuming that we work on the model that if "connectionLost" is called, i can set a flag.
But from the twisted model, in RequestAvatar, the "mind" is not set to the instance of the protocol, so there is no way to
reference the instance of the protocol? Referencing the factory itself is of no value since we are interested to find out the connection = account pair.
Or is there a way to get access to the current protocol instance from RequestAvatar?

Marcus.

Glyph Lefkowitz wrote:

On Oct 16, 2010, at 10:02 AM, Marcus.CM wrote:

How do i find out if a particular connection is already dead in the 
given "account" class?

There's no way to know; it's a race condition.  If the connection dies before authentication, then requestAvatar won't be called.  If the connection dies shortly afterward, you'll get a connectionLost shortly after authentication, but there's no way to predict that that's about to happen.

If the connection dies at the exact moment that authentication occurs... well, the joke's on you, in a network of Von Neumann architecture computers, there's no such thing as the "exact moment".  It actually died shortly afterwards, just so shortly that it seemed simultaneous to a casual human observer.  So as far as the code's concerned, it's the same as the "shortly afterward" case.

_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to