I am doing peer to peer wireless communication with two QNX6.3.2 machines using UDP. sending is okay, but on the recvfrom() thread, the program stuck just in the recvfrom() call, and the TimerTimeout(CLOCK_REALTIME,
_NTO_TIMEOUT_CONDVAR | _NTO_TIMEOUT_MUTEX | _NTO_TIMEOUT_RECEIVE, NULL, &nWait, NULL); could not timeout after 2ms of blocking in recvfrom(). even no data arrived, then the recvfrom() still should return after the timeout. i set the timeout value to 2ms.
Look for your help.
Another possibility would be to use a UNIX style code where you call alarm(1) before the call to recvfrom(). If no packet is received within one second, the kernel will deliver a signal SIG_ALM and recvfrom() should return with EINTR. Although you cannot get anything smaller than 1 second it is worth a try.
thx, i got the point. the qnx doc: “Always call TimerTimeout() just before the function that you wish to timeout”. i just put one timertimeout before pthread_cond_wait, and forgot before the other–recvfrom().