Jump to content

vha

Members+
  • Posts

    4
  • Joined

  • Last visited

Everything posted by vha

  1. you want to say that i can't use select() on DS? than why this guy is using it?: http://www.1emulation.com/forums/index.php?showtopic=22833 as you can see code is very similar
  2. How can I interrupt waiting for data in recv() function? I must wait until function recive data from server to proceed. while (1) { readbytes = recv(gniazdo, (char*)&glowa, sizeof(glowa), 0 ); if (Stylus.X<19 && Stylus.Y>172) { if(keybord<=0) {if(keybord==-1)PA_InitKeyboard(2);PA_KeyboardIn(20, 95); keybord=1;} else {PA_KeyboardOut();keybord=0;} Stylus.X=0; Stylus.Y=0; } . . . } If i dont get data then i can't read stylus position. I solve this problem on my PC: struct timeval tv = {0,0}; while(1) { fd_set fs = {1,gniazdo}; if (select(0, &fs,NULL,NULL,&tv) == 1) { readbytes = recv(gniazdo, (char*)&glowa, sizeof(glowa), 0); if (...) { ... } . . . } But this method don’t seam to work on DS what is wrong with my code? how can I fix it? sorry for my poor Englis
  3. hi, I have this code for windows: struct sockaddr_in sin; struct hostent* host; host = gethostbyname("appmsg.gadu-gadu.pl"); sin.sin_family = AF_INET; sin.sin_addr.s_addr = *((unsigned long*) host->h_addr); sin.sin_port = htons(80); and i want to use it on my DS, but when i compile someting like this: #include <PA9.h> #include "main.h" . . . struct sockaddr_in client; struct hostent* host; host = gethostbyname("appmsg.gadu-gadu.pl"); client.sin_family = AF_INET; client.sin_addr.s_addr= *((unsigned long*) host->h_addr); client.sin_port = htons(80); I get: " error: 'struct hostent' has no member named 'h_addr' How to fix this? (sorry for my poor English)
×
×
  • Create New...