Original Post
Dear Forum, I ran into a strange phenomenon. Maybe you can help me, and if you do, I'd very much appreciate it ;) Here we go: I have a non .net server running, that occasionally sends out TCP packages with a size of roughly 500 Bytes. On the client side (where my problem occurs) I have a System.Windows.Forms.Timer timer, that ticks every 10ms. In that tick I check if something was sent by the server and needs to be processed. I check that with the static socket.select function. Everything seems to be working just fine until about 1500 Bytes. From there on my receive buffer is somewhat corrupt. It is not that all data is rubbish, but there are some errors in it. First I was guessing that the MTU has something to do with it but then I changed the tick frequency of the timer from 10 to 20 and the problem was resolved.... until the server sent about 4500 Bytes. From there on the buffer again was corrupt. Here again what happens on the client side in a few source snippets: I hope you can help me with a link, tipp, suggestion,..., anything Regards Woltan
//Somewhere before
ConnectionTimer = new Timer();
ConnectionTimer.Tick += new EventHandler(ConnectionTimer_Tick);
ConnectionTimer.Interval = 10;
ConnectionTimer.Start();
void Recv()
{
List<Socket> lTemp = new List<Socket>();
lTemp.Add(TCP);
Socket.Select(lTemp, null, null, 5);
if(lTemp.Contains(TCP))
{
Int32 iRecv = TCP.Receive(RecvBuffer);
InterpreteBuffer(RecvBuffer, iRecv);
}
}