Altera_Forum
Honored Contributor
19 years agoSocket problem when flooding
Hello,
I'm having a strange issue with TCP socket. I'm trying to write to a socket stream as fast as possible so I do something like :c = 'a';
while(1) {
write(sock, &c, sizeof(c));
} I use a telnet client to test my code : I get a random number of 'a', a freeze, and then the sock hangs (write return -1 with errno set to EPIPE). I've used ethereal to investigate. The problem is the board is sending a TCP packet with a wrong checksum. This packet is send several times and then the board send a RST. It seems to me there is something wrong with memory which corrupt the packet's data. Did someone succeed flooding a socket stream ? I'm using the FreeBSD stack on a cyclone II developement board with the default network settings. thanks in advance, sly