views:

193

answers:

5

I am a begginer C++ programmer. In C#, I used the System.Net.Sockets.Socket class, which represents a networking socket, to create/connect a server. How can I do the same thing in C/C++? Are there any classes like this?

+6  A: 

In windows theres a library called winsock.dll.

In Unix, you can use unix sockets

Then, theres boost sockets

beej guide to internet sockets

windows sockets

boost networking

Tom
A: 

Sockets are not a fundamental part of either C or C++. If you are on Windows, start off with Winsock.

dirkgently
A: 

I've done a little bit with libcurl, this question has tonnes of answers:

http://stackoverflow.com/questions/118945/best-c-c-network-library

...OK to be fair, libcurl doesn't work directly with sockets, so maybe it's not what you're looking for. But it does support a great many protocols.

FrustratedWithFormsDesigner
+1  A: 

I would recommend reading beej's guide to Network Socket programming. It is a really good source full of good explanations.

Robert Massaioli
A: 

Since you used System.Net.Sockets.Socket in C#, you can use System::Net::Sockets::Socket in C++/CLI--a language which is a .NET flavor of C++.

Dan