satrn
v0.6.99
Published
SATRN is a ECMASCRIPT6 implementation of RUDP for use in streaming JSON objects over IP Networks. RUDP implements features similar to TCP with less overhead. Matrix Post-Processing allows for checksum of individual packets without need of complete binary
Downloads
1
Readme
SATRN
Capable: RUDP, JSON
[Note: All Copyrights/Trademarks aformentioned are heretoforth property of their respective parties. No ownership claimed] Written + Modified by Emanuel Fludd email: [email protected] License: MIT Credit: Raul Martins RUDP
SATRN is a ECMASCRIPT6 implementation of RUDP for use in streaming JSON objects over IP Networks. RUDP implements features similar to TCP with less overhead. Matrix Post-Processing allows for checksum of individual packets without need of complete binary checksums. A most efficient process. Over-Buffering allows for streaming of binary objects incredibly fast where as TCP introduces too much overhead.
In computer networking, the Reliable User Datagram Protocol is a transport layer protocol designed at Bell Labs for the Plan 9 operating system. It aims to provide a solution where UDP is too primitive because guaranteed-order packet delivery is desirable, but TCP adds too much complexity/overhead. In order for RUDP to gain higher Quality of Service, RUDP implements features that are similar to TCP with less overhead.
In order to ensure quality, it extends UDP by means of adding the following features:
Acknowledgment of received packets
Windowing and flow control
Retransmission of lost packets
Over buffering (Faster than real-time streaming)
RUDP is not currently a formal standard, however it was described in an IETF internet-draft in 1999. It has not been proposed for standardization.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
JSON is built on two structures:
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
SATRN Automatically generates serialized JSON objects once passed through a client/server connection object. Handling and detection of objects is encapsulated out of the functional aspects of your code. Data integrity is maintained while enjoying the light overhead requirements of UDP.
Usage Example
/*
Written by Emanuel Fludd
email: [email protected]
License: MIT
RUDP IETF Draft Reference:
https://www.ietf.org/archive/id/draft-ietf-sigtran-reliable-udp-00.txt
T. Bova, T. Krivoruchka (Cisco Systems)
Now works with Object Streams, Strings and Objects!
*/
var satrn = require("satrn");
var fs = require("fs");
var server = satrn.createServer( (ob) => {
if(ob.isStream){
console.log("Streamed Content Size: "+Math.round(ob.body.length/1024)+" KB");
}else{
console.log("Content Body: "+ob.body);
}
});
server.listen(7770);
var mac = satrn.connect("127.0.0.1",7770, ()=> {
var stream = fs.createReadStream("./song.ogg");
mac.stream(stream);
mac.write("I Just Sent A Song!");
mac.write({body:"I Just Sent A Song!"});
});