Valhalla Legends Forums Archive | C/C++ Programming | Winsock classes?

AuthorMessageTime
Okee
Hey. My bot connects and stuff, but I was wondering - are there any classes out there or wrappers people have made that make the winsock portion of console C++ bots any cleaner? My code is real messy and I was going to try and make some sort of class or wrapper to make it a little easier - by why reinvent the wheel, eh? Just wondering if anyone has anything like this.
May 9, 2005, 10:38 PM
Myndfyr
If you're supporting ActiveX in your project, you may (or may not) be able to use the Microsoft Winsock OCX.
May 9, 2005, 11:42 PM
Mangix
http://www.cplusplus.com/src/

scroll down to windows programs and you will find a C++ Winsock wrapper.
May 21, 2005, 4:27 AM
OnlyMeat
[quote author=MyndFyre link=topic=11538.msg111785#msg111785 date=1115682159]
If you're supporting ActiveX in your project, you may (or may not) be able to use the Microsoft Winsock OCX.
[/quote]

Apart from the fact people usually code in c/c++ to avoid costly COM marshaling, the Microsoft Winsock OCX requires a window handle for notifying the container of specific events. This guy is writing a console app, so that would be unsuitable.

Also, the fact that COM uses an apartment threading model causes major headaches for a multithreaded c/c++ app. Besides that, using/implementing COM interfaces in pure c/c++ is no trivial task.
May 21, 2005, 7:45 PM

Search