Esempio n. 1
0
 public void stop() {
   _thread.stop();
   try {
     _socket.close();
   } catch (Exception e) {
     Logger.error("@ClientMediator.stop error");
   }
   // kill tank
 }
Esempio n. 2
0
 public void toberun() {
   if (_writer == null || _reader == null) {
     Logger.error("@ClientMediator.toberun: _writer or _reader null");
     return;
   }
   String s;
   while (true) {
     s = null;
     try {
       s = _reader.readLine();
     } catch (Exception e) {
       Logger.error("@ClientMediator.toberun: _read error, excep is " + e.toString());
       break;
     }
     if (s != null && s.length() > 0) {
       handleResquest(new String(s));
     }
   }
   Arena.addReq(_id, Const.LOSE_CONNECTION, null);
 }