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