You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
578 B
23 lines
578 B
var io = require('socket.io-client');
|
|
|
|
function SocketIoConnection(config) {
|
|
this.connection = io.connect(config.url, config.socketio);
|
|
}
|
|
|
|
SocketIoConnection.prototype.on = function (ev, fn) {
|
|
this.connection.on(ev, fn);
|
|
};
|
|
|
|
SocketIoConnection.prototype.emit = function () {
|
|
this.connection.emit.apply(this.connection, arguments);
|
|
};
|
|
|
|
SocketIoConnection.prototype.getSessionid = function () {
|
|
return this.connection.id;
|
|
};
|
|
|
|
SocketIoConnection.prototype.disconnect = function () {
|
|
return this.connection.disconnect();
|
|
};
|
|
|
|
module.exports = SocketIoConnection;
|
|
|