Jump to content

blocking?


knight0fdragon

Recommended Posts

WHAT??????????

 

 

what dont u understand?????

 

 

i want to use sync sockets not async, but for some reason it seems its async by default

 

and i like to use the DS as a server, so that other DS's could communicate via wifi but the function gethostbyaddr will not recognize the IP on the DS, itll act as if the IP doesnt exist

Link to comment
Share on other sites

This is a legitimate question. To set a socket nonblocking use this after you bind() it:

 

ioctl(sock, FIONBIO, &i);

 

'sock' is the socket of course, and 'i' should be an int set to a nonzero value to set it as nonblocking.

 

I don't know about your second question though.

Link to comment
Share on other sites

i want blocking, not non blocking. I do not use that code you said, but for some reason, recvfrom is not waiting for data like its suppose to

 

as for the second question, has anyone placed the DS into server mode??? I ask this because it is like my PC does not recognize the IP when i access it

Link to comment
Share on other sites

i want blocking, not non blocking.  I do not use that code you said, but for some reason, recvfrom is not waiting for data like its suppose to

 

as for the second question, has anyone placed the DS into server mode???  I ask this because it is like my PC does not recognize the IP when i access it

 

As for the blocking, I use a while loop with timeout, something like

 

int time=0;

while (time<maxtime){

j=rcvdfrom(blabla)

if j!=-1

break;

time++;

swiWaitForVbalnk

}

 

in this case maxtime is the timeout (if you don't want to wait forever) and so it's a number of vblanks (60/second). like, for a blockng of 5 seconds, maxtime=60*5

 

Hope this helps...

 

Bafio

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...