Hello all,
I've got a VERY strange network problem with Win2k Server and .NET.
I've got one central server (hub) getting raw binary data (files) from
many locations. Both server and clients are written in C#
The server is quite simple: two threads, one accepts new connections
and decides whether the client is authenticated to send data or not, and
the other thread serves already connected clients: performs a
Socket.Select and then gets one file from each client that is ready to
send data. Reading data uses Socket.Poll method so that I can set up a
timeout (to avoid DOS) on receiving.
On Win2k3 everything works well, but on Win2k Server the hub gets files
that have correct size but bad data inside: there comes the beginning
part of file (correct data), a sequence of zero bytes (about 200-300
bytes long) and then the rest of the data, up to the requested size.
The communication protocol is simple: client sends a fixed byte and
then four bytes of file length, after that file data. The server
verifies the fixed byte has correct value, reads the size, and then as
many bytes of file data as the client specified. So when the sequence of
zeros gets read the real file gets truncated and whole communication is
broken.
What can cause such a strange behaviour? Select? Poll? Anything else?
Thanks for any advice,
Grzegorz Kaczor