I'm coming from Tcl-world ...

Robin Becker robin at jessikat.fsnet.co.uk
Sat Aug 3 18:48:19 CEST 2002


In message <20020803185701.A18720 at hishome.net>, Oren Tirosh <oren-py-
l at hishome.net> writes
.......
>> >Have you tried asyncore?
>> >
>> >       Oren
>> >
>> yes, it's quite a mess working out what's going on.
>
>Yes, you're right. The asyncore documentation could be better. Actually it's 
>very simple to use:
>
>Write an object with the following methods:
>
>   writable() - return true if you wish to get write events
>   readable() - return true if you wish to get read events
>
>   handle_error() - called on any errors
>   handle_write_event() - called on write event
>   handle_read_event() - called on read event 
>       also called on EOF, in that case reading will return ''
>
>set socket_map[fd] to point to this object (multiple objects, more likely)
>call asyncore.loop(optional_timeout)
>The loop will return either on timeout or when one of the handlers
>raises the asyncore.ExitNow exception.
>
>That's all.
......
Inspired by Steve Holden in another thread I was just looking at
    http://www.python.org/dev/doc/devel/lib/module-asyncore.html
and see no mention of the handle_write_event & handle_read_event
methods. I assume they're aliases for handle_write and handle_read.
-- 
Robin Becker




More information about the Python-list mailing list