recvfrom
Posted: Tue May 11, 2010 7:07 am
Is recvfrom stop all task until it received UDP message? and how to solve this?
Code: Select all
#include <sys/types.h>
#include <sys/socket.h>
// no need to use this, because it's included in socket.h #include <sys/ioctl.h>
⋮
int dontblock;
int rc;
int server_sock
⋮
/* Place the socket into nonblocking mode */
dontblock = 1;
rc = ioctl(server_sock, FIONBIO, (char *) &dontblock);