diff options
Diffstat (limited to 'js/src/Ice/ConnectionReaper.js')
-rw-r--r-- | js/src/Ice/ConnectionReaper.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/js/src/Ice/ConnectionReaper.js b/js/src/Ice/ConnectionReaper.js new file mode 100644 index 00000000000..af8faa2ef26 --- /dev/null +++ b/js/src/Ice/ConnectionReaper.js @@ -0,0 +1,39 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +(function(global){ + + require("Ice/Class"); + + var Ice = global.Ice || {}; + + var ConnectionReaper = Ice.Class({ + __init__: function() + { + this._connections = []; + }, + add: function(connection) + { + this._connections.push(connection); + }, + swapConnections: function() + { + if(this._connections.length === 0) + { + return null; + } + var connections = this._connections; + this._connections = []; + return connections; + } + }); + + Ice.ConnectionReaper = ConnectionReaper; + global.Ice = Ice; +}(typeof (global) === "undefined" ? window : global)); |