Jump to content

Recommended Posts

Posted (edited)

how do i turn blocking on for recvfrom???

 

 

also can the DS act as a server??? for some reason gethostbyaddr will not work from the PC side to the DS IP

Edited by knight0fdragon
Posted
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

Posted

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.

Posted

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

Posted
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

Posted

yea that is what I am using now, I just thought that I was missing something here, but I guess not. Ok then thanks a lot, I just need some answer on the server, perhaps thats not gonna happen till the next installment of the lib

Posted
int time=0;

while (time<maxtime){

j=rcvdfrom(blabla)

if j!=-1

  break;

time++;

swiWaitForVbalnk

}

I've got some nit-picking:

It's swiWaitForVblank(); not swiWaitForVbalnk

 

:(

 

parrot

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...