gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Non blocking sockets?

#161871 - 3dfx - Sat Aug 16, 2008 2:42 am

I'm sure it's in the dswifi library but I can't seem to find a function that will make my sockets non blocking. So is there a fcntl function or something similar to it? Oh, and will using non blocking sockets slow down the cpu too much?

#161874 - melw - Sat Aug 16, 2008 12:00 pm

Code:
int nbMode = 1;
int bMode = 0;

ioctl(sockfd,FIONBIO,&bMode); // set blocking
ioctl(sockfd,FIONBIO,&nbMode); // set non-blocking

#161880 - 3dfx - Sat Aug 16, 2008 7:22 pm

Oh thanks. :)