Sockets in (Visual) C++
Posted: Wed Oct 07, 2009 2:05 pm
Hey everyone,
I have what seems like a really, really dumb question. I'm trying to do some socket programming in C++ using Visual Studio. Despite some online references about WinSock, none of the code I'm attempting works. I'm talking real simple stuff like binding a socket, nothing about sending/receiving, just getting the damn thing open.
I'm from a UNIX background and have done some pretty decent work using native Berkeley sockets, but this was in C and the socket library is well documented.
Do I need to write some C wrappers around anything to get sockets working in C++? There are probably some third party libs out there (boost perhaps), but I'd like to keep this as minimalist as possible without using too many outside libraries. So far the only external libraries I've included in my project are OpenGL and DirectX. Ideally I'd like to have some sort of socket class to do networking related tasks for the game protocols between client and server, and keep it as streamlined and manageable as possible.
A point in the right direction would be most helpful.
-capt jack
I have what seems like a really, really dumb question. I'm trying to do some socket programming in C++ using Visual Studio. Despite some online references about WinSock, none of the code I'm attempting works. I'm talking real simple stuff like binding a socket, nothing about sending/receiving, just getting the damn thing open.
I'm from a UNIX background and have done some pretty decent work using native Berkeley sockets, but this was in C and the socket library is well documented.
Do I need to write some C wrappers around anything to get sockets working in C++? There are probably some third party libs out there (boost perhaps), but I'd like to keep this as minimalist as possible without using too many outside libraries. So far the only external libraries I've included in my project are OpenGL and DirectX. Ideally I'd like to have some sort of socket class to do networking related tasks for the game protocols between client and server, and keep it as streamlined and manageable as possible.
A point in the right direction would be most helpful.
-capt jack