Re: non-blocking socket bug?

[email protected] (( Marc) (A.) (Lehmann ))
Newsgroups perl.loop
Message-ID <[email protected]>
On Tue, Oct 09, 2001 at 11:02:37PM -0300, Raul Dias <[email protected]> wrote:
> I think I might have found another bug in Event.
> 
> when this watcher gets called the socket will be in blocking mode
> ( $socket->blocking == 1 ).

Are you really sure? I use event since a long time and it worked fine in
this respect. I guess your code changes the blocking, can you code a small
example that shows the problem?

> This won't make a difference for line based protocols that just use
> <$socket>

Using <> on a non-blocking socket will not work, as any kind of buffered
i/o will most probably not work with event, sicne event only works on the
filehandle, not any internal buffers.

> for reading, but it will block until the end of the connection
> to the client if using sysread ($socket->sysread(); )

It would block until sysread's bufefr is full, not only till
end-of-conenction.

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [email protected]      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.