|
-
October 10th, 2007, 10:09 AM
#2
Re: winsock recv incomplete message problem
If you are sharing the receiveBuffer1 buffer amongst four different threads, then you probably lack synchronization between the threads, such that one thread is writing to the buffer (maybe the main thread) while other threads expect the buffer to be constant.
Incidentally, creating a new thread is time-consuming, and your code apparently does so for each and every new datagram that's received. A better architecture would be a thread pool, where all threads in the pool are already created, but are in a wait state until work is given to them. That way, there's no overhead lost in thread creation.
Mike
Last edited by MikeAThon; October 10th, 2007 at 11:58 AM.
Reason: fix typo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|