Winsock: CSocket or something else?
-
Hi, The CSocket class has been widely publicised as being buggy: the advice has historically been to use a 3rd party control or write your own. Has the CSocket class with MFC supplied with VS2008 been updated, or is the current advice to use a 3rd party control / write your own? Can anyone reccommend a 3rd party / free TCP wrapper? (Yes I'm aware there are plenty of example applications here on CP, but which one is the best) thanks, Mark.
-
Hi, The CSocket class has been widely publicised as being buggy: the advice has historically been to use a 3rd party control or write your own. Has the CSocket class with MFC supplied with VS2008 been updated, or is the current advice to use a 3rd party control / write your own? Can anyone reccommend a 3rd party / free TCP wrapper? (Yes I'm aware there are plenty of example applications here on CP, but which one is the best) thanks, Mark.
My suggestion is
ACE framework
. Please check, http://www.cs.wustl.edu/~schmidt/ACE.html[^] http://www.riverace.com/about_ace.htm[^]. To be honest, I've never used ACE, but heard that its a good and robust one. So have a look at it and if seems useful, then go for it. :) Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
Hi, The CSocket class has been widely publicised as being buggy: the advice has historically been to use a 3rd party control or write your own. Has the CSocket class with MFC supplied with VS2008 been updated, or is the current advice to use a 3rd party control / write your own? Can anyone reccommend a 3rd party / free TCP wrapper? (Yes I'm aware there are plenty of example applications here on CP, but which one is the best) thanks, Mark.
I don't know how buggy it is - it does what it's documented to do. It's a very simple designed wrapper around the Winsock APIs. It works fine for simple socket tasks (on one thread). If you need performance you'll need asynchronous communications. You can use the CAsyncSocket - it works pretty well and it's a very thin wrapper around the socket APIs so you could use straight APIs almost as easily. The important thing is to know how sockets work and how to use the APIs. Then the MFC classes will make more sense and you'll be able to use them effectively. The source code for those classes is the ultimate documentation, and it's relatively easy to read. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: