node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

pomelo-sio-client

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) host
    • port (Number) port
    • reconnectionAttempts (Number) number of reconnection attempts before giving up (Infinity)