• Welcome to Valhalla Legends Archive.
 

Winsock classes?

Started by Okee, May 09, 2005, 05:38 PM

Previous topic - Next topic

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.

MyndFyre

If you're supporting ActiveX in your project, you may (or may not) be able to use the Microsoft Winsock OCX.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

http://www.cplusplus.com/src/

scroll down to windows programs and you will find a C++ Winsock wrapper.

OnlyMeat

#3
Quote from: MyndFyre on May 09, 2005, 06:42 PM
If you're supporting ActiveX in your project, you may (or may not) be able to use the Microsoft Winsock OCX.

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.