Best C/C++ Network Library

Best C/C++ Network Library

Aggregated List of Libraries

  • Boost.Asio is really good.
  • Asio is also available as a stand-alone library.
  • ACE is also good, a bit more mature and has a couple of books to support it.
  • C++ Network Library
  • POCO
  • Qt
  • Raknet
  • ZeroMQ (C++)
  • nanomsg (C Library)
  • nng (C Library)
  • Berkeley Sockets
  • libevent
  • Apache APR
  • yield
  • Winsock2(Windows only)
  • wvstreams
  • zeroc
  • libcurl
  • libuv (Cross-platform C library)
  • SFML's Network Module
  • C++ Rest SDK (Casablanca)
  • RCF
  • Restbed (HTTP Asynchronous Framework)
  • SedNL
  • SDL_net
  • OpenSplice|DDS
  • facil.io (C, with optional HTTP and Websockets, Linux / BSD / macOS)
  • GLib Networking
  • grpc from Google
  • GameNetworkingSockets from Valve
  • CYSockets To do easy things in the easiest way
  • yojimbo
  • GGPO
  • ENet
  • SLikeNet is a fork of Raknet
  • netcode
  • photon is closed source, requires license to use their sdk
  • crossplatform network - open source non blocking metatemplate framework built on top of boost asio

c++ network programming library

The library you want is asio. It's available standalone or as part of the boost libraries.

It's free and cross-platform, supports multi-threading, asynchronous sockets, synchronous sockets, timers, work queues....

It's about as close to being 'standard' as you can get without being in the c++ standard.

http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio.html

http://think-async.com/Asio

Cross Platform C++ Networking (without big library)

The Berkeley sockets API is the most common low-level socket API. It is supported on all POSIX platforms which means both Linux and macOS will have it.

Even Windows have it, but with a slight twist since sockets aren't descriptors like they are on POSIX systems.

Using sockets directly will lead to more boiler-plate code, but it is definitely possible to use it to make a simple HTTP client that supports only simple GET requests.

There are many tutorials and references on using sockets. Beej's Guide to Network Programming seems to be a popular tutorial, which should have notes about the tweaks needed for Windows.

Simple cross-platform networking framework/library for c++ and Java

So what C++ and Java library or framework do you recommend to begin with?

Protocol Buffers is likely the easiest framework. It allows cross-platform communication between Java, C++ and Python (and probably a few others by now).

I've heard that Java is better that c++ for network applications, is that true?

No.

What are the best languages to integrate with C for networking?

You simply need a higher-level library, not an entirely different language.

C is extensible through libraries; if you don't like the basic BSD socket API choose (or write) a wrapper library with an API you are happier with. If you are using application layer protocols you probably want to do that in any case - the socket API accesses the transport layer (layer 4 in the OSI model) which is probably why you perceive it as being complicated from an application layer perspective.

There are many libraries that provide network services on top of the socket API. There are even more if you use C++ which is entirely interoperable with C code. If you were prepared to interoperate with another language in order to get network support, you might consider using C++ rather than C in any case and avoid any interoperability issues.

Take a look at the "question" Best C/C++ Network Library for a list of C and C++ networking libraries.

What are some interesting C/C++ libraries to play around with?

STL and Boost are musts.

SQLite provides a completely embedded, full-featured relational database in a few 100k that you can include right into your project. It's also a highly marketable skill because of its high presence (it's included in Mozilla Firefox as well as Android and iOS).

If you're interested in creating user interfaces, look into ncurses -- it's the library that was used to create many terminal user interfaces and can be very useful for creating games and shell utilities. Qt is a good GUI framework for C++.

If you're interested in graphics or creating games, consider SDL or OpenGL (or DirectX if you don't mind only working on Windows).

Of course, there are thousands of interesting libraries. It really depends on what you're interested in.

Resources to learn Networking with C++

Given your newness to C++, I would not recommend building directly on the sockets APIs unless you can find no suitable library to use. Boost.Asio will give you a huge head start and expose you to the higher-level abstractions used in network programming.

It's easy when starting out building a sockets-based system to get something that 'sort of' works and then spend weeks debugging corner cases that only happen under real-world timing and load conditions. Using boost::asio correctly is hardly a cakewalk even if it shields developers from the complexities of raw socket handling.

If the goal is to learn how to use raw sockets (or some other transport mechanism such as RPC) correctly, then by all means roll your own using online samples and docs to understand the individual BSD or Winsock APIs - if the goal is to solve a business problem as quickly as possible with high quality code on both business and networking infrastructure side, then use a good networking library. In this case your question does indicate a wish to learn so using a library may not be the best way to achieve your stated goal.

What is a popular, multi-platform, free and open source socket library

I believe both the Apache Portable Runtime and GTK+'s GLib libraries have socket APIs. Since your question is tagged c and c++ I suspect you really want C++-centric answers, but both of these are good as pure C libraries.

Networking in C/C++?

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



Related Topics



Leave a reply



Submit