Hi,
i have been woundering how one can do socket programing in C++.
i know there are alot of c tutorials out there but how can this be done in c++?
Thanks,
jeff
There's no standard library for C++ socket programming. There's lots of non-standard ones out there, though. Just do a Google search. I can't recommend any personally.
is working on one, but they aren't done yet, so it's not in any of the releases. When they get done with it, though, it'll probably be pretty good, and a likely candidate for an addition to the new C++ Standard.
Do you really need one? At most, the library will just save you the bother of putting the SOCKET in a global variable. You could always write a class wrapper for it, which shouldn't take more than 15 minutes.
The constructor will do the socket call. The destructor will be the close. Then the rest are just member functions using the object handle instead of providing the socket to the call. Don't really see what you'd gain by putting them into a class.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.