Alon Gubkin
Alon Gubkin

Reputation: 57119

Networking in C/C++?

I am a beginner 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++? Are there any classes like this?

Upvotes: 0

Views: 1422

Answers (4)

Tom
Tom

Reputation: 45104

In windows theres a library called winsock.dll.

In Unix, you can use unix sockets

Then, there’s boost sockets

beej guide to internet sockets

windows sockets

boost networking

Upvotes: 8

Robert Massaioli
Robert Massaioli

Reputation: 13477

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

Upvotes: 1

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

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.

Upvotes: 0

dirkgently
dirkgently

Reputation: 111120

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

Upvotes: 0

Related Questions