[Tutor] sockets

Praveen Pathiyil ppathiyi@cisco.com
Wed, 4 Jul 2001 13:41:21 +0530


Hi,
        There is a select module which gives you the asynchronous behaviour.
The select call returns the socket descriptor on which there is any data to
be read. Calling this in a separate thread could do the job. Hence if you
want to do some processing while you wait for the data to arrive, you can
use the select call.

http://www.python.org/doc/current/lib/module-select.html

        If you would like to take a look at more code which does similar
things, there is a page about the Medusa project. This was referred to me by
Danny when i was doing some stuff on telnet server. It really bailed me out
on a couple of occasions.

 http://www.nightmare.com/medusa/

Regards,
Praveen.

----- Original Message -----
From: "Brendon" <bren@europe.nl.com>
To: <tutor@python.org>
Sent: Wednesday, July 04, 2001 1:23 PM
Subject: Re: [Tutor] sockets


> On Wednesday 04 July 2001 09:44, you wrote:
> > On Mon, 2 Jul 2001, Danny Yoo wrote:
> > What you'll probably want to look at is a way of asking the socket: "if
> > there's anything interesting coming at us from the server,
> > tell us about
> > it.  But if not, let me do my own thing."
>
> yup..
>
> > I think this is asynchronous
> > io, but I've never actually played with async stuff before.  You might
> > want to look at:
> >
> >     http://python.org/doc/lib/module-asyncore.html
> >
> > which seems to have some good documentation on doing asyncronous IO.
> > I'll need to take a look at the Stevens book myself, one of these days,
to
> > understand what's happening.
>
> more documents to read, there goes my summer holiday :)
>
> --
>
> "if we live by an "eye for an eye and a tooth for a tooth"...before long,
> the whole world will be blind and toothless."
>          --Tevye, Fiddler on the Roof
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>