Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
/ RUDP Public archive
forked from Raulmsm/RUDP

A reliable UDP Javascript implementation for node.js

Notifications You must be signed in to change notification settings

BrixsterPlanet/RUDP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

A reliable UDP Javascript implementation for node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%