Mercurial > hg > RemoteEditor > REPSessionManager
comparison test/sematest/TestEditor.java @ 471:d2762d669617
sleep command to wait for singleton prevention
author | one |
---|---|
date | Tue, 12 Oct 2010 10:19:59 +0900 |
parents | c83af820eb62 |
children | ebfa3b05a8dd |
comparison
equal
deleted
inserted
replaced
470:7f0d4e49eaf9 | 471:d2762d669617 |
---|---|
175 case REPCMD_DELETE_USER: | 175 case REPCMD_DELETE_USER: |
176 String del = text.delete(cmd.lineno); | 176 String del = text.delete(cmd.lineno); |
177 cmd.setString(del); | 177 cmd.setString(del); |
178 sendCommand(cmd); | 178 sendCommand(cmd); |
179 break; | 179 break; |
180 case SMCMD_SLEEP: | |
181 try { | |
182 sleep(1000); | |
183 } catch (InterruptedException e) { | |
184 } | |
185 break; | |
180 case SMCMD_QUIT: | 186 case SMCMD_QUIT: |
181 /* | 187 /* |
182 * start termination phase 1 by the master editor. | 188 * start termination phase 1 by the master editor. |
183 * after this command do not send any user input. | 189 * after this command do not send any user input. |
184 * clients simply disconnect from the session manager. | 190 * clients simply disconnect from the session manager. |
229 channel.write(cmd); | 235 channel.write(cmd); |
230 } | 236 } |
231 | 237 |
232 private void handle(REPCommand cmd) { | 238 private void handle(REPCommand cmd) { |
233 if (cmd==null) return; | 239 if (cmd==null) return; |
234 ns.writeLog(name +": read "+cmd + " textsize="+text.size()); | 240 ns.writeLog(name +": read "+cmd + " textsize="+text.size()+" "+text); |
235 switch(cmd.cmd) { | 241 switch(cmd.cmd) { |
236 case REPCMD_INSERT : | 242 case REPCMD_INSERT : |
237 if (cmd.eid!=eid) { | 243 if (cmd.eid!=eid) { |
238 text.insert(cmd.lineno, cmd.string); | 244 text.insert(cmd.lineno, cmd.string); |
239 } | 245 } |