From: Darren Date: Fri, 30 Aug 2013 11:06:26 +0000 (+0100) Subject: Engine.io + Engine.io.tools implemented X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3343212821f3622178c0f71ebd6d90f801c50c84;p=KiwiIRC.git Engine.io + Engine.io.tools implemented --- diff --git a/client/assets/libs/websocketrpc.js b/client/assets/libs/websocketrpc.js deleted file mode 100644 index 01554f8..0000000 --- a/client/assets/libs/websocketrpc.js +++ /dev/null @@ -1,164 +0,0 @@ -/* - Create a document explaining the protocol -*/ - -function WebsocketRpc(eio_socket) { - var self = this; - - this._next_id = 0; - this._callbacks = {}; - this._socket = eio_socket; - - this._mixinEmitter(); - this._bindSocketListeners(); -} - - -WebsocketRpc.prototype._bindSocketListeners = function() { - var self = this; - - // Proxy the onMessage listener - this._onMessageProxy = function rpcOnMessageBoundFunction(){ - self._onMessage.apply(self, arguments); - }; - this._socket.on('message', this._onMessageProxy); -}; - - - -WebsocketRpc.prototype.dispose = function() { - if (this._onMessageProxy) { - this._socket.removeListener('message', this._onMessageProxy); - delete this._onMessageProxy; - } - - this.removeAllListeners(); -}; - - - - -/** - * The engine.io socket already has an emitter mixin so steal it from there - */ -WebsocketRpc.prototype._mixinEmitter = function() { - var funcs = ['on', 'once', 'off', 'removeListener', 'removeAllListeners', 'emit', 'listeners', 'hasListeners']; - - for (var i=0; i