comparison rep/ServerMainLoop.java @ 420:5c95a9020e31

Modify ServerMainLoop
author one
date Fri, 13 Feb 2009 19:13:50 +0900
parents 2c815dd5f797
children 03ab374605a6
comparison
equal deleted inserted replaced
419:7ff127c8ad64 420:5c95a9020e31
60 public void mainLoop() throws IOException { 60 public void mainLoop() throws IOException {
61 while(true){ 61 while(true){
62 manager.checkWaitingCommandInMerge(); 62 manager.checkWaitingCommandInMerge();
63 if (checkInputEvent() || 63 if (checkInputEvent() ||
64 checkWaitingWrite()) { 64 checkWaitingWrite()) {
65 continue;
65 // try to do fair execution for waiting task 66 // try to do fair execution for waiting task
66 if(selector.selectNow() > 0) select(); 67 //if(selector.selectNow() > 0) select();
67 continue; 68 //continue;
68 } 69 }
69 // now we can wait for input packet or event 70 // now we can wait for input packet or event
70 selector.select(); 71 selector.select();
71 select(); 72 select();
72 } 73 }