Java: Began work on hub listeners.
[doldaconnect.git] / lib / java / dolda / dolcon / protocol / Connection.java
index 03152bc..b596639 100644 (file)
@@ -183,9 +183,10 @@ public class Connection {
        }
     }
 
-    public void qcmd(Command cmd) {
+    public void qcmd(Command... cmds) {
        synchronized(queue) {
-           queue.offer(cmd);
+           for(Command cmd : cmds)
+               queue.offer(cmd);
            queue.notifyAll();
        }
     }
@@ -212,6 +213,7 @@ public class Connection {
                    notifyAll();
                }
            };
+       qcmd(cmd);
        synchronized(l) {
            while(!donep[0]) {
                l.wait();
@@ -284,7 +286,9 @@ public class Connection {
                            out.append(' ');
                        out.append(quote(s));
                    }
+                   out.append("\r\n");
                    w.write(out.toString());
+                   w.flush();
                }
            } catch(IOException e) {
                throw(new StopCondition(e, false));
@@ -378,7 +382,6 @@ public class Connection {
                                code = Integer.parseInt(ct.toString());
                                ct.setLength(0);
                                state = "start";
-                               continue eat;
                            } else {
                                ct.append(c);
                            }