recvfrom

Post Reply
dheart88
Posts: 44
Joined: Sun Dec 13, 2009 3:00 pm

recvfrom

Post by dheart88 » Tue May 11, 2010 7:07 am

Is recvfrom stop all task until it received UDP message? and how to solve this?

dheart88
Posts: 44
Joined: Sun Dec 13, 2009 3:00 pm

Re: recvfrom

Post by dheart88 » Tue May 11, 2010 8:31 am

problem solved:
there's ioctl function... I didn't know about the function until I read socket.h and compare the function from other resources... use

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);

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests