[Chicago] Socket question

deadwisdom at gmail.com deadwisdom at gmail.com
Thu Dec 3 22:02:12 CET 2009


You can't be reading from both at the same time, though. It blocks while  
it's reading. You'll have to create a new thread or use Eventlet  
(http://eventlet.net/), which is currently my favorite python library ever.  
Damn is it cool.

On Dec 3, 2009 10:00am, Kumar McMillan <kumar.mcmillan at gmail.com> wrote:
> 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))

> _______________________________________________

> Chicago mailing list

> Chicago at python.org

> http://mail.python.org/mailman/listinfo/chicago

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20091203/0a46202d/attachment.htm>


More information about the Chicago mailing list