You shouldn&#39;t bind your client on a port where your server is listening to.<br><br>---<br>Alvin<br><br><div class="gmail_quote">On Fri, Jan 9, 2009 at 9:23 PM, Alessio Pace <span dir="ltr">&lt;<a href="mailto:alessio.pace@gmail.com">alessio.pace@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;">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>_______________________________________________<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><br clear="all"><br>-- <br><a href="http://www.alvinatorsplayground.blogspot.com/">http://www.alvinatorsplayground.blogspot.com/</a><br>