<br><br><div class="gmail_quote">On Fri, Jan 9, 2009 at 3:01 PM, Alvin Delagon <span dir="ltr">&lt;<a href="mailto:adelagon@gmail.com">adelagon@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You shouldn&#39;t bind your client on a port where your server is listening to.</blockquote><div><br>I&#39;m following what is written in &quot;Peer-to-Peer Communication Across Network Address Translators&quot; in order to implement TCP hole punching, and they suggested to do so..<br>
<br>Regards,<br>--<br>Alessio Pace.<br><br>&nbsp;</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>---<br>Alvin<br><br><div class="gmail_quote">
<div><div></div><div class="Wj3C7c">On Fri, Jan 9, 2009 at 9:23 PM, Alessio Pace <span dir="ltr">&lt;<a href="mailto:alessio.pace@gmail.com" target="_blank">alessio.pace@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">Hi,<br><br>I would lilke tro listen on a given TCP port and initiate multiple TCP client connections from the same port, but I&#39;m encountering the classical:<br>

<br>&nbsp; &lt;class &#39;twisted.internet.error.ConnectBindError&#39;&gt;: Couldn&#39;t bind: 98: Address already in use<br>
<br>My code is:<br><br>######################################<br><br>&nbsp;&nbsp;&nbsp; factory = Factory()<br>&nbsp;&nbsp;&nbsp; # an almost empy subclass of Protocol<br>&nbsp;&nbsp;&nbsp; factory.protocol = TCPServer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; reactor.listenTCP(12345, factory)<br>


&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; # ClientFactory subclass which simply instantiate a TCPClient Protocol<br>&nbsp;&nbsp;&nbsp; client_factory = TCPClientFactory()<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; # last tuple is the bindAdress parameter<br>&nbsp;&nbsp;&nbsp; reactor.connectTCP(target_addr, 12345, client_factory, 30, (source_addr, 12345))<br>


<br>#######################################<br><br>I&#39;ve tried to look on the Internet and in the source code but I&#39;ve not found a proper solution.<br><br>Thanks in advance for any suggestion.<br><font color="#888888">Alessio Pace.<br>

<br>

</font><br></div></div>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/" target="_blank">http://www.alvinatorsplayground.blogspot.com/</a><br>
</font><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br>