예제 #1
0
 public void quit() {
   if (isQuit.compareAndSet(false, true) && !isClosed()) {
     if (isAuthenticated) {
       // QS_TODO check
       write(writeToBuffer(QuitPacket.QUIT, allocate()));
       write(processor.getBufferPool().allocate());
     } else {
       close();
     }
   }
 }
예제 #2
0
 @Override
 public void error(int errCode, Throwable t) {
   LOGGER.warn(toString(), t);
   switch (errCode) {
     case ErrorCode.ERR_HANDLE_DATA:
       // handle error ..
       break;
     case ErrorCode.ERR_PUT_WRITE_QUEUE:
       // QS_TODO
       break;
     default:
       close();
       if (handler instanceof MySQLConnectionHandler) {
         ((MySQLConnectionHandler) handler).connectionError(t);
       }
   }
 }
예제 #3
0
 public void closeNoActive() {
   if (isClosed.compareAndSet(false, true)) {
     close();
   }
 }