Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Socket problem when flooding

Altera_Forum
Honored Contributor II
972 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
303 Views

It is in fact a driver issue. There is a patch here (http://forum.niosforum.com/forum/lofiversion/index.php/t3277.html). 

 

It works great now !
0 Kudos
Reply