.NET BeginReceive problems (multithreading)
I wonder if anybody can help me out here: I''m using C# to try and write a chat program, but I think multithreading is causing me problems. Basically, I''m using the Socket.BeginReceive method to generate callbacks whenever data arrives from the server, but it seems that if the server sends too quickly then I lose data --- the callback is called once, then it seems that before it gets a chance to call EndReceive, the callback gets generated again by more data arriving, and it throws everything into confusion. Anybody know how to fix this?
Cheers,
Andy
May 23, 2004 07:24 AM
Wait until you are finished processing the current message before calling BeginReceive again.
Also, be aware that the threadpool used for managing async methods is limited. It might not handle large player counts.
Also, be aware that the threadpool used for managing async methods is limited. It might not handle large player counts.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement