private int devnum;
public Listener(int devnum) { this.devnum = devnum; }
public void run() {
- try {
- while(true) {
+ while(true) {
+ try {
Socket s = null;
synchronized(Server.class) {
System.err.println("thread " + devnum + " listening");
System.err.println("connection");
}
new Handler(s, devnum).run();
- }
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
+ try { Thread.sleep(1000); } catch (Exception e) { }
+ }
}
}