At 08:17 PM 10/10/01 -0300, Raul Dias wrote: >The problem is not related to Event.pm, but how sockets works in general. > >when you accept a connection like: >$client = $socket->accept; > >$client will be in blocking mode _even_ if $socket is in non-blocking mode.
This (AFAIK) can be adjusted by setting the listening socket into non-blocking mode. Since the accepted (new) socket is initialized with the params of the listening socket, it will be non-blocking from the beginning. I can't find a reference for this, offhand. This also solves a situation that can occur if the listening socket has accept called, but the connecting peer has gone away in the time between the listening socket being marked as readable (i.e. "connection is waiting") and the time your program gets around to it. Check Stevens' Unix Network Programming Vol I, section 15.6 (pg 422) for details. I have used Event with non-blocking connects and non-blocking accepts quite successfully. Good luck! Bruce --------------- Bruce McKenzie [EMAIL PROTECTED]