After many experiments, I decided to write a very simple test case, because I suspected a bug in the sdk somewhere... and the test case crashes, exactly at the 7th time!
So it probably is an SDK bug (my SDK was installed 2 days ago, got latest versions of everything).
I use an EzFlash Vi on a DSi.
Test case does just the following:
Code: Select all
void tcpserv(){
int sd, psd,addrlen;
struct sockaddr_in name,addr;
sd = socket (AF_INET,SOCK_STREAM,0);
name.sin_family = AF_INET;
name.sin_addr.s_addr = htonl(INADDR_ANY);
name.sin_port = htons(80);
bind(sd, (struct sockaddr *)&name, sizeof(name));
listen(sd,1);
addrlen=sizeof(addr);
while(1){
do{
psd = accept(sd,(struct sockaddr *)&addr, &addrlen);
} while(!psd);
printf("%d,",psd);
shutdown(psd,SHUT_RDWR);
close(psd);
}
}
Prebuild NDS at: http://pty.yi.org/dstcplistener.nds