GithubHelp home page GithubHelp logo

rudp's Introduction

RUDP

RUDP is a javascript implementation of "reliable" UDP for node.js. It aims to provide a solution where UDP is too primitive because realiable packet delivery is desirable, but TCP adds too much overhead. In order for RUDP to gain higher Quality of Service, RUDP implements features that are similar to TCP with less overhead.

For now the only feature it adds on top of UDP is just guaranteed packet delivery. This is good enough if you wish to send requests where the only thing that matters is guaranteed delivery with no duplicates, i.e. order of arrival does not matter.

Ideally it will progress towards the classical features described in http://en.wikipedia.org/wiki/Reliable_User_Datagram_Protocol and might add other useful features while being faster than TCP.

Depending on the usefulness/interest this gets I will consider implementing this as proper protocol in C and exposing to node via bindings.

Usage Example

var rudp = require("../lib/rudp");

var SAMPLE_PORT = 8080;

var totalRequestsReceived = 0;

function StartRUDPBenchmarkServer() {
	var rudpServer = rudp.createServer(function(msg)  {
		totalRequestsReceived++;
	}); 

	rudpServer.listen(SAMPLE_PORT);
}

function SendNonStop() {
	var req = rudp.send('127.0.0.1', SAMPLE_PORT, 'test'); 

	setImmediate(SendNonStop);
}

function main() {
	StartRUDPBenchmarkServer();
	setInterval(function () {
		console.log(totalRequestsReceived);
		totalRequestsReceived = 0;
	}, 1000); 

	SendNonStop();
}

main();

rudp's People

Contributors

raulmsm avatar asrient avatar

Watchers

James Cloos 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.