-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support numbers returned from :events() #5
Comments
Committed. |
Thanks! closed with b3d5284 |
P.S. you should add POLLPRI to the allowed mask |
I do need to add proper :recvmsg and :sendmsg calls which allow reading and sending OOB data, support SO_OOBINLINE as a socket option, etc. It's just not a high-priority at the moment. It will require careful testing across all the platforms. I added the mask because the assignment is a signed, narrowing conversion (.events is a short) and I was just trying to be conscientious about undefined behavior. I only included POLLIN and POLLOUT in the mask because those are the only events currently supported. I could have made the mask 0x7fff but figured it was more prudent to filter out values which previously wouldn't have been seen. |
I totally understand that.
By the cqueues socket library.... |
The code has to translate POLLIN and POLLOUT to the subsystem-specific flag. For Linux it's easy because POLLIN, POLLOUT, and POLLPRI are identical to EPOLLIN, EPOLLOUT, and EPOLLPRI. I think Solaris just reuses POLLIN directly. However, for kqueue I haven't researched the issue. Some quick Googling turned up EV_OOBAND, but it's not documented in the OS X man page, and it doesn't even exist on OpenBSD. The only application I know of off-hand that uses OOB data is telnet. FWIW, a grep through the PostgreSQL sources, for example, doesn't turn up any matches for "POLLPRI" or "MSG_OOB". |
yeah this is low priority compared to my other issues. I knew how easy it would be for EPOLL; but didn't consider the other platforms. |
I often already have a bitmask ready for
poll()
from a 3rd party C lib.Could you make it so the
:events()
function can (optionally) return a number; which is the bitset ofPOLLIN
,POLLOUT
, etc?The text was updated successfully, but these errors were encountered: