![](smile.gif)
Multithreaded AND async sockets...?
Hello,
I've written a simple win32 console app that uses multithreading. The only problem is that the threads are not asyncronus. I'm not quite sure how to impliment the WSASelectAsnyc() fucntion into a mutltithreaded program due to the fact that you have to use the message pump for the window in a REAL windows program. Does ne1 have any snippets or links or general architecture for a program like this?
I guess another way of asking is something i saw on a web site, something about using "WSARecv" and a "thread event"?? whats that about?
THANKS
"There are no such things as stupid questions...
Just stupid people
"
-Me
[edited by - TheTempest on October 3, 2002 9:45:49 AM]
![](smile.gif)
"There are no such things as stupid questions...Just stupid people :)"-Me
One solution is an event synchronization. You need to know when to read data and when to wait for data. That is one use of an event kernel object in a Winsock application.
For example, let say you get a notice from WSAAsyc of incoming data. After you start a new thread and read data, there are, however, still data left. One solution is to use an event to pause the worker thread from looping.
Kuphryn
For example, let say you get a notice from WSAAsyc of incoming data. After you start a new thread and read data, there are, however, still data left. One solution is to use an event to pause the worker thread from looping.
Kuphryn
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement