Skip to content
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

terminate called after throwing an instance of 'std::runtime_error' revents != POLLWRNORM #38

Closed
chenscottus opened this issue Sep 13, 2023 · 3 comments

Comments

@chenscottus
Copy link

Hello,

Could you please explain to me what this error means, and how to resolve it?
if (payload.second.revents != POLLWRNORM) {
throw std::runtime_error("revents != POLLWRNORM\n");
}
//terminate called after throwing an instance of 'std::runtime_error' revents != POLLWRNORM

Many thanks!

-Scott

@chenscottus
Copy link
Author

sys/poll.h
#define POLLWRNORM 0x0100 /* Writing now will not block */

@chenscottus
Copy link
Author

http://www.qnx.com/developers/docs/6.5.0SP1.update/index.html#com.qnx.doc.neutrino_lib_ref/p/poll.html#id9
POLLWRNORM
Equivalent to POLLOUT.
The significance and semantics of normal, priority, and high-priority data are file- and device-specific.

If the value of fd is less than 0, events is ignored, and revents is set to 0 in that entry on return from poll().

In each pollfd structure, poll() clears the revents member, except that where the application requested a report on a condition by setting one of the bits of events listed above, poll() sets the corresponding bit in revents if the requested condition is true. In addition, poll() sets the POLLHUP, POLLERR, and POLLNVAL flag in revents if the condition is true, even if the application didn't set the corresponding bit in events.

If none of the defined events occurs on any selected file descriptor, poll() waits at least timeout milliseconds for an event to occur on any of the selected file descriptors. If the value of timeout is 0, poll() returns immediately. If the value of timeout is -1, poll() blocks until a requested event occurs or until the call is interrupted.

The poll() function isn't affected by the O_NONBLOCK flag.

The poll() function reports regular files, terminal and pseudo-terminal devices, FIFOs, and pipes.

Regular files always poll TRUE for reading and writing.

A file descriptor for a socket that's listening for connections indicates that it's ready for reading, once connections are available. A file descriptor for a socket that connects asynchronously indicates that it's ready for writing, once a connection has been established.

@chenscottus
Copy link
Author

After running a few days in ubuntu 20.04, It means we cannot write the encode image to the stream ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant