Class | Poll |
In: |
poll.c
lib/poll.rb |
Parent: | Object |
An object-oriented poll() implementation for Ruby
POLLIN | = | INT2NUM(POLLIN) | ||
IN | = | INT2NUM(POLLIN) | ||
POLLPRI | = | INT2NUM(POLLPRI) | ||
PRI | = | INT2NUM(POLLPRI) | ||
POLLOUT | = | INT2NUM(POLLOUT) | ||
OUT | = | INT2NUM(POLLOUT) | ||
POLLERR | = | INT2NUM(POLLERR) | ||
ERR | = | INT2NUM(POLLERR) | ||
POLLHUP | = | INT2NUM(POLLHUP) | ||
HUP | = | INT2NUM(POLLHUP) | ||
POLLNVAL | = | INT2NUM(POLLNVAL) | ||
NVAL | = | INT2NUM(POLLNVAL) | ||
POLLRDNORM | = | INT2NUM(POLLRDNORM) | ||
RDNORM | = | INT2NUM(POLLRDNORM) | ||
POLLRDBAND | = | INT2NUM(POLLRDBAND) | ||
RDBAND | = | INT2NUM(POLLRDBAND) | ||
POLLWRNORM | = | INT2NUM(POLLWRNORM) | ||
WRNORM | = | INT2NUM(POLLWRNORM) | ||
POLLWRBAND | = | INT2NUM(POLLWRBAND) | ||
WRBAND | = | INT2NUM(POLLWRBAND) | ||
POLLMSG | = | INT2NUM(POLLMSG) | ||
MSG | = | INT2NUM(POLLMSG) | ||
Version | = | /([\d\.]+)/.match( %q$Revision: 1.10 $ )[1] | Class constants | |
Rcsid | = | %q$Id: poll.rb,v 1.10 2002/10/21 03:47:01 deveiant Exp $ |
Call the system-level poll function with the handles registered to the receiver. Any callbacks specified when the handles were registered are run for those handles with events. If a block is given, it will be invoked once for each handle which doesn‘t have an explicit handler. The timeout argument is the number of floating-point seconds to wait for an event before returning; negative timeout values will cause poll to block until there is at least one event to report. This method returns the number of handles on which one or more events occurred.
Register the specified IO object with the specified eventMask. If the optional callback parameter (a Method or Proc object) or a block is given, it will be called with io and the mask of the event/s whenever poll generates any events for io. If the callback parameter non-nil, any block specified is discarded. Any arguments specified are passed to the callback as the third and succeeding arguments. The following event masks can be set in the eventMask:
The following masks are ignored in the eventMask, as they are always implicitly set, but they may be specified in the handler callback or block to trap the conditions they represent:
If your operating system defines them, these masks are also available:
Remove the specified io from the receiver‘s list of registered handles, if present. Returns the handle if it was registered, or nil if it was not.