Coder Social home page Coder Social logo

libudx's Introduction

libudx

udx is reliable, multiplex, and congestion controlled streams over udp.

It's written in C99 and depends on libuv.

It is pre-alpha wip (there be dragons), but at a stage where it's safe for developers to poke at.

The main purpose is to be a building block for P2P networking. It therefore doesn't come with any handshaking protocol, encryption, and things like that - just reliable, fast, streams.

API

TODO

Node.js bindings

npm install udx-native

Building

Two build setups are available: A GYP build and a CMake build.

GYP

The GYP build is used for building a dynamic library for use in Node.js.

node-gyp configure
node-gyp build

The above commands are run as part of npm install.

CMake

The CMake build is used for building static and dynamic libraries for use outside of Node.js.

cmake -S . -B build
cmake --build build

Debugging

When debugging native code, make sure to configure a debug build:

# GYP
node-gyp configure --debug

# CMake
cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug

Memory errors

To diagnose and debug memory errors, such as leaks and use-after-free, the collection of sanitizers provided by LLVM are recommended. The sanitizers can be enabled by passing additional CFLAGS and/or LDFLAGS to the CMake or GYP build:

# GYP
CFLAGS=<...> LDFLAGS=<...> node-gyp build

# CMake
CFLAGS=<...> LDFLAGS=<...> cmake -S . -B build

To read more about the various sanitizers and how to use them, see:

โš ๏ธ LeakSanitizer is still experimental and currently requires a newer version of LLVM on macOS. If using Homebrew, brew install llvm and CC=/usr/local/opt/llvm/bin/clang should be sufficient.

LICENSE

MIT

libudx's People

Contributors

mafintosh avatar kasperisager avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.