summaryrefslogtreecommitdiff
path: root/NET/worlds/network/WaitList.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/network/WaitList.java')
-rw-r--r--NET/worlds/network/WaitList.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/NET/worlds/network/WaitList.java b/NET/worlds/network/WaitList.java
new file mode 100644
index 0000000..580a149
--- /dev/null
+++ b/NET/worlds/network/WaitList.java
@@ -0,0 +1,69 @@
+/* */ package NET.worlds.network;
+/* */
+/* */ import java.io.PrintStream;
+/* */ import java.util.Vector;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class WaitList
+/* */ {
+/* 21 */ private Vector<ConnectionWaiter> _waitList = new Vector();
+/* */ private Object _parent;
+/* */
+/* */ protected WaitList(Object parent)
+/* */ {
+/* 26 */ this._parent = parent;
+/* */ }
+/* */
+/* */ protected synchronized void addWaiter(ConnectionWaiter cw)
+/* */ {
+/* 31 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) {
+/* 32 */ System.out.println(this._parent + ": waitForConnection(" + cw + ")");
+/* */ }
+/* 34 */ if (this._waitList.indexOf(cw) < 0)
+/* 35 */ this._waitList.addElement(cw);
+/* */ }
+/* */
+/* */ protected synchronized void abortWait(ConnectionWaiter cw) {
+/* 39 */ assert (this._waitList.indexOf(cw) != -1);
+/* 40 */ this._waitList.removeElement(cw);
+/* */ }
+/* */
+/* */ protected synchronized void clear() {
+/* 44 */ this._waitList = new Vector();
+/* */ }
+/* */
+/* */ protected synchronized void notify(boolean connected)
+/* */ {
+/* 49 */ if (((Galaxy.getDebugLevel() & 0x4000) > 0) &&
+/* 50 */ (this._waitList.size() > 0)) {
+/* 51 */ System.out.println(this._parent + ": notify(" + connected + ")");
+/* */ }
+/* 53 */ for (int i = this._waitList.size() - 1; i >= 0; i--) {
+/* 54 */ ConnectionWaiter cw = (ConnectionWaiter)this._waitList.elementAt(i);
+/* */
+/* 56 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) {
+/* 57 */ System.out.println("\tnotifying " + cw);
+/* */ }
+/* 59 */ cw.connectionCallback(this._parent, connected);
+/* 60 */ this._waitList.removeElementAt(i);
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WaitList.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file