Socket programming in VC++
-
sakssp wrote:
how to set the highest priority to socket program.
Why do you think you want to boost the priority? :suss: Chances are that the error you're trying to "correct" by tweaking the priorities is a design flaw. Tweaking the priorities of threads and processes is almost always wrong, or at least the wrong tool for the job. Don't mistake Windows for a real-time OS. When you write it like that, I read it like "how can I disguise my error to make it even harder to track down". ;) What seems to be the most common mistakes when developing socket applications are...
- CSocket is used without the developer knowing that CSocket is a blocking implementation. Converting to CAsyncSocket is usually the medicine for this.
- CSocket and/or CAsyncSocket is used in a multithreaded application and worker threads are used instead of UI-threads. The threads that the sockets reside in have to pump messages and thus must be UI-threads.
See here[^] to get some more ideas. If you neither find this post nor the link above helpful, post again and describe what you're trying to accomplish and what you've done so far. Especially if you still think you need to tweak the priorities of your process and its threads.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Another alternative to Roger's excellent suggestions. Use Winsock directly instead of using the wrapper classes. Then you can implement an event- driven model instead of using window messages for asynchronous socket communication. Then you don't need UI threads. Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder