Skip to content

XSocketsNodeJs Test

Uffe Björklund edited this page Jun 11, 2015 · 17 revisions
var xsockets = require('xsockets.net');

var c = new xsockets.TcpClient('192.168.254.154', 4502, ['generic']);
var g = c.controller('generic');
g.on('foo', function(d) {
    console.log('foo',d);
});

g.onopen = function(ci) {
    console.log('connected controller generic');
    g.send('foo', {text:'bar'});
}

c.onconnected = function(d) {
    console.log('connected', d);
}
c.open();
Clone this wiki locally