knight0fdragon Posted February 9, 2006 Share Posted February 9, 2006 (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 February 9, 2006 by knight0fdragon Link to comment Share on other sites More sharing options...
Warlord698 Posted February 9, 2006 Share Posted February 9, 2006 WHAT?????????? Link to comment Share on other sites More sharing options...
knight0fdragon Posted February 9, 2006 Author Share Posted February 9, 2006 WHAT??????????<{POST_SNAPBACK}> 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 More sharing options...
Sintax Posted February 9, 2006 Share Posted February 9, 2006 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 More sharing options...
Warlord698 Posted February 9, 2006 Share Posted February 9, 2006 I guesse I just didn't understand what he was wanting to do it for, like for a specific program or just in general, still learning on stuff ya know Link to comment Share on other sites More sharing options...
knight0fdragon Posted February 9, 2006 Author Share Posted February 9, 2006 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 More sharing options...
bafio Posted February 9, 2006 Share Posted February 9, 2006 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<{POST_SNAPBACK}> 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 More sharing options...
knight0fdragon Posted February 9, 2006 Author Share Posted February 9, 2006 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 Link to comment Share on other sites More sharing options...
parrot Posted February 9, 2006 Share Posted February 9, 2006 int time=0;while (time<maxtime){ j=rcvdfrom(blabla) if j!=-1 break; time++; swiWaitForVbalnk}<{POST_SNAPBACK}>I've got some nit-picking:It's swiWaitForVblank(); not swiWaitForVbalnk parrot Link to comment Share on other sites More sharing options...
bafio Posted February 9, 2006 Share Posted February 9, 2006 int time=0;while (time<maxtime){ j=rcvdfrom(blabla) if j!=-1 break; time++; swiWaitForVbalnk}<{POST_SNAPBACK}>I've got some nit-picking:It's swiWaitForVblank(); not swiWaitForVbalnk parrot<{POST_SNAPBACK}> Well also blabla is not really ok Bafio Link to comment Share on other sites More sharing options...
MaHe Posted February 9, 2006 Share Posted February 9, 2006 About the server. Port a server application to DSLinux. It should work then. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now