Possible Duplicate:
Socket Programming for Windows C/C++
I am trying to understand what my options are for doing socket programming in C++ (non-managed) under Visual Studio 2010. Please note that one constraint I have is that I cannot use a third-party library. I must use only the capabilities provided directly by Visual Studio.
It seems there are two options:
- Use the Win32 (Winsock) API. This API is Unix-like.
- Use MFC.
Are these indeed the only two options? Or is there a newer, more “modern” way of doing socket programming?
Regards,
Dave
The only way of doing it in Windows is using the Win32 Socket API (which is indeed POSIX compatible, for better or for worse). Both MFC and the .NET implementations are just wrappers around it.
If you can go higher level than just a socket though, say to the TCP or even HTTP (or FTP) levels, there are alternatives like the
Internetclass of Win32 functions.