You shouldn'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"><<a href="mailto:alessio.pace@gmail.com">alessio.pace@gmail.com</a>></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'm encountering the classical:<br>
<br> <class 'twisted.internet.error.ConnectBindError'>: Couldn't bind: 98: Address already in use<br>
<br>My code is:<br><br>######################################<br><br> factory = Factory()<br> # an almost empy subclass of Protocol<br> factory.protocol = TCPServer<br> <br> reactor.listenTCP(12345, factory)<br>
<br> # ClientFactory subclass which simply instantiate a TCPClient Protocol<br> client_factory = TCPClientFactory()<br> <br> # last tuple is the bindAdress parameter<br> reactor.connectTCP(target_addr, 12345, client_factory, 30, (source_addr, 12345))<br>
<br>#######################################<br><br>I've tried to look on the Internet and in the source code but I'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>