Mercurial > hg > RemoteEditor > REPSessionManager
diff test/sematest/TestEditor.java @ 288:d93b062eadaa
*** empty log message ***
author | kono |
---|---|
date | Mon, 29 Sep 2008 05:11:49 +0900 |
parents | 30c993e89286 |
children | 9c553308b918 |
line wrap: on
line diff
--- a/test/sematest/TestEditor.java Sun Sep 28 15:46:36 2008 +0900 +++ b/test/sematest/TestEditor.java Mon Sep 29 05:11:49 2008 +0900 @@ -88,20 +88,24 @@ channel.register(selector, SelectionKey.OP_READ); while(running) { if (selector.select(timeout)<=0) { - REPCommand cmd = cmds.poll(); - if (cmd!=null) { - text.edit(cmd); - sendCommand(cmd); - } else { - // no more command to send - timeout = 0; - } + userInput(); } else { handle(channel.read()); } } } + private void userInput() { + REPCommand cmd = cmds.poll(); + if (cmd!=null) { + text.edit(cmd); + sendCommand(cmd); + } else { + // no more command to send + timeout = 0; + } + } + private void sendCommand(REPCommand cmd) { cmd.setSEQID(seq++);