pomelo-sio-client
v1.0.3
Published
pomelo client, base socket.io-client
Downloads
50
Readme
Pomelo sio client
pomeol client,base socket.io-client
Getting Start
npm install pomelo-sio-client
Scripts
var pomelo = require('pomelo-sio-client');
var pomeloclient = new pomelo({"debug":true});
pomeloclient.init({ "host": host, "port": port,"reconnectionAttempts":3 }, function (socket) {
pomeloclient.request("chat.userHandler.addUser", args,
function (data) {
pomeloclient.disconnect();
console.log(data);
});
});
pomeloclient.on("error", function (err) {
pomeloclient.disconnect();
console.log(err);
});
API
new pomelo(options:Object)
options
(Object)debug
(Boolean) console log
pomelo.init(options:Object,cb:Function)
options
(Object)host
(String) hostport
(Number) portreconnectionAttempts
(Number) number of reconnection attempts before giving up (Infinity)