Skip to content

Stream-Technologies/spread-bindings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spread For Node

Javascript bindings for The Spread Toolkit

Usage

var spread = require("spread-for-node");

//Connecting to a Spread daemon is pretty simple
var mbox = spread.connect("localhost", 4803 ,"testuser",0,0);

//Wait until a connection is established.
mbox.on("connect", function(){
	
	//So is joining a channel
	mbox.join("channel");

	//lets send a simple message
	mbox.multicast(spread.SAFE_MESS, ['channel'], 0, new Buffer([1,2,3,4,5]));
});

//Listen for recieved messages
mbox.on("receive", function(serviceType, sender, groups, type, endianMismatch, data){
	//Do things with the recieved messages
})

mbox.on("error", function(error){
	console.log("[ERROR]", error.message);
})

About

Javascript implementation of the Spread Toolkit client protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published