Skip to content

cfnptr/nets

Repository files navigation

NETS CI

A library providing generic interface for transferring data over a network across different platforms.

Features

  • Blocking / non-blocking socket
  • Stream client / server (TCP)
  • Datagram client / server (UDP)
  • Secure socket layer (OpenSSL)
  • Datagrams over TCP stream
  • HTTP client (TLS, Compression)

Supported operating systems

  • Ubuntu
  • MacOS
  • Windows

Build requirements

OpenSSL installation

  • Ubuntu: sudo apt install libssl-dev
  • MacOS: brew install openssl
  • Windows: choco install openssl

CMake options

Name Description Default value
NETS_BUILD_SHARED Build Nets shared library ON
NETS_BUILD_EXAMPLES Build Nets usage examples ON
NETS_USE_OPENSSL Use OpenSSL for secure communication ON
NETS_ALLOW_DEPRECATED_SSL Allow deprecated OpenSSL functions OFF

Cloning

git clone --recursive https://github.com/cfnptr/nets

Usage examples

Datagram client / server example: examples/datagram_example.c
HTTPS client (OpenSSL) example: examples/https_example.c

Third-party

  • mpmt (Apache-2.0 License)
  • OpenSSL (Apache-2.0 License)
  • zlib (zlib License)

Inspired by

Special thanks to Gigaflops.