Networking question

Leon Pollak leonp at plris.com
Fri May 2 19:35:33 UTC 2008


Hello, all.

I have one TCP socket which is used simultaneously by 10 tasks (according to 
my checks in the internet, this is allowed, yes?).

Tasks 1-9 are looping on writing something with about 20Hz frequency 
(send(so,...) then 20ms sleep), task 10 (which opened the socket) does 
read(so...), which has a packet once in half an hour.

The problem occurs in about 70% of the cases when on the other side (PC with 
Windows XP) user cancels the application.

In 30% of good cases, all send(so...) finishes with -1 and read(so,...) as 
well.

Very nice, except that there are other 70%, when the "read" operation ends 
with -1, while almost all send's do not (some times one does).

When I dump out the tasks states in the bad case, I see that all these are 
waiting for events (which is not my case, as I do only rtems_task_wake...).

Can somebody of network gurus explain me my error?

Thanks ahead.
-- 
Leon



More information about the users mailing list