[Chicago] Socket question

Kumar McMillan kumar.mcmillan at gmail.com
Thu Dec 3 17:00:33 CET 2009


On Thu, Dec 3, 2009 at 9:03 AM, perlsyntax
<fasteliteprogrammer at gmail.com> wrote:
> Is there away in python i can connect to a server in socket to two servers
> at the same time or can't it be done?


it's just an object, you can instantiate as many as you want.  See:
http://docs.python.org/library/socket.html#example

then modify with:

PORT = 50007              # Arbitrary non-privileged port
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s1.bind(('creditcardnumbers.ru', PORT))
s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s2.bind(('customeraddresses.ru', PORT))


More information about the Chicago mailing list