Log in

View Full Version : Socket programming in VC++ 2005


Ryan M.
14-06-2005, 08:12
I recently downloaded the VC++ 2005 Beta 2 from MS. I haden't worked with it before, so this morning I set out to create a simple network app to check if my server is up and accessible from the outside world. (And yes, I'll give it to a friend, where he'll set it up as a scheduled task.) I could have finished it by now in VS.NET 2003, but it appears that sockets are somewhat different in 2005. I'm unable to find the proper header/library to use. Winsock as a direct library doesn't appear to exist anymore and I couldn't seem to find a non-.NET way of doing it.

Do you know how to create a socket in 2005? All it has to do is check if it can connect to a certain server on port 80, if that makes a difference. :) (but if you happen to know how to use the .NET version, I might have to.)

I'm stubborn, so don't even suggest I just use 2003. ;)

Nate Smith
14-06-2005, 15:35
I haven't actually worked with it, but check this page out...
http://msdn2.microsoft.com/library/1612451t(en-us,vs.80).aspx

BTW, if you didn't know this already, http://msdn2.microsoft.com is all of the documentation for VS2005...note that some parts are still incomplete, since it is still in beta...

Ryan M.
14-06-2005, 15:47
I haven't actually worked with it, but check this page out...
http://msdn2.microsoft.com/library/1612451t(en-us,vs.80).aspx

BTW, if you didn't know this already, http://msdn2.microsoft.com is all of the documentation for VS2005...note that some parts are still incomplete, since it is still in beta...Yes, I did know that that was where the docs where, but I didn't find the first link. Thanks.

Now... how exactly do you include that in your C++ program? The System.[etc] syntax is used directly in C#, but in C++...?

fowlerm
15-06-2005, 20:03
This article (http://msdn.microsoft.com/coding4fun/inthebox/netutils/default.aspx) covers simple network tasks with .NET 2.0, it uses all managed code though.