Question

I'm coding a UDP datagram receiver in C++ on the QNX operating system and I want to perform non-blocking recvfrom() calls.

The QNX man page on recvfrom() suggests that I somehow can put a socket in a non-blocking mode using ioctl(). Unfortunately, the man page on ioctl() isn't much of a help.

Can anybody tell me about the arguments I have to pass to ioctl() to set the socket to non-blocking?

Was it helpful?

Solution

The ioctl doc for QNX 6.4.0 has a bit more info:

FIONBIO

Set or clear non-blocking I/O

The ioctl call should look something like this:

int on = 1;
ioctl(fd, FIONBIO, &on);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top