<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>ClientCreator is not proper for my case, because I need the re-connect ability.<br>
<br><br></blockquote><div><br>I made a tricky for access to the protocol instance created, but I don&#39;t know if this is sane for the structure of twisted. Is something like this:<br>----------<br>class P(Protocol):<br>
&nbsp;&nbsp;&nbsp; def connectionMade(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.factory.instance = self<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br>&nbsp;&nbsp;&nbsp; ...<br><br>&nbsp;&nbsp;&nbsp; def connectionLost(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.factory.instance = None<br><br>class F(Factory): <br>&nbsp;&nbsp;&nbsp; protocol = P
<br>&nbsp;&nbsp;&nbsp; instance = None<br>&nbsp;&nbsp;&nbsp; ...<br>----------<br>then you can access to protocol instance inside the factory, if it&#39;s not None.<br clear="all"></div></div>If somebody see an inconsistency or a better sugestion please let me know.
<br><br>Francisco<br>-- <br>&quot;El hombre se descubre cuando se mide con un obstáculo&quot; <br>(Saint Exupéry)