Help - Search - Members - Calendar
Full Version: sendto() doesn't work after the first time I call it
1Emulation.Com > Official Emulator Forums > DSWifi
ECB
Topic has the description. I'm using a nonblocking UDP socket. This is weird, and I have no idea where to look for the problem.

I've counted the amount returned by all those sendto() calls and it matches the amount that i've been sending. This means that all my sendto()s where successful...right?

Could the problem with the program I'm using to receive the data being sent? I have no idea how to check it though.
ECB
And some code:
QUOTE
int sock;
struct sockaddr_in sain;
sock=socket(AF_INET,SOCK_DGRAM,0);
sain.sin_family=AF_INET;
sain.sin_port=htons(8888);
sain.sin_addr.s_addr=INADDR_ANY;
bind(sock,(struct sockaddr *) &sain,sizeof(sain));
int tempI=1;
ioctl(sock,FIONBIO,&tempI);

sain.sin_family=AF_INET;
sain.sin_port=htons(8888);
sain.sin_addr.s_addr=inet_addr("192.168.0.105");

char lolChar1 = 50;
char lolChar2 = 51;

sendto(sock, &lolChar1, sizeof(lolChar1),0,(struct sockaddr *)&sain,sizeof(sain));
sendto(sock, &lolChar2, sizeof(lolChar2),0,(struct sockaddr *)&sain,sizeof(sain));


For some reason, I receive a 50 but not a 51 on the other end. In the wifi_lib_test, I went to the UDP test and added another sendto() right beside the original call. It works, I receive two values instead of one. What am I missing here?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.