in reply to Re^4: Using Net::Server::Multiplex and polling Spread
in thread Using Net::Server::Multiplex and polling Spread

Sounds like it could work, if you implement your Spread polling inside the hook you added. I'm not sure what the alarm stuff is for. Isn't the whole point of select() that it doesn't block? Let us know how it works out.
  • Comment on Re^5: Using Net::Server::Multiplex and polling Spread

Replies are listed 'Best First'.
Re^6: Using Net::Server::Multiplex and polling Spread
by superfrink (Curate) on Jul 09, 2004 at 18:14 UTC
    Isn't the whole point of select() that it doesn't block? Let us know how it works out.
    Not quite, select() does block until one of the following happens:
    1. One of the file descriptors is in a state where it will not block if use to read or write.
    2. Something exceptional happened to a file descriptor. (Like the other side of a network connection closed the connection.)
    3. A timeout expires. (Passed as an argument to the select() call.)
      Update: timeout can be zero which causes select to not block.
    4. A signal arrives. This lets the main loop of a process deal with events triggered by signals. (Usually the signal handler just sets a global flag and the main loop checks for the flag.)
    Some details based on the man page for select(2) found on my Linux system today. Your system might vary.