<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Ok assuming that we work on the model that if "connectionLost" is
called, i can set a flag.<br>
But from the twisted model, in RequestAvatar, the "mind" is not set to
the instance of the protocol, so there is no way to<br>
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.<br>
Or is there a way to get access to the current protocol instance from
RequestAvatar?<br>
<br>
Marcus. <br>
<br>
Glyph Lefkowitz wrote:
<blockquote
cite="mid:F07EE17E-CC1F-41B0-AA8D-3DFD03CE31B1@twistedmatrix.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=us-ascii">
<br>
<div>
<div>On Oct 16, 2010, at 10:02 AM, Marcus.CM wrote:</div>
<br>
<blockquote type="cite"><span><span>How do i find out if a particular
connection is already dead in the<span> </span><br>
given "account" class?</span></span></blockquote>
</div>
<br>
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a class="moz-txt-link-freetext" href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
</pre>
</blockquote>
<br>
</body>
</html>