private void readClose ( FrameIn fIs ) throws IOException { if ( _state . isClosed ( ) ) { return ; } _state = _state . closePeer ( ) ; int code = fIs . readClose ( ) ; StringBuilder sb = new StringBuilder ( ) ; fIs . readText ( sb ) ; if ( _service != null ) { WebSocketClose codeWs = WebSocketCloses . of ( code ) ; try { _service . close ( codeWs , sb . toString ( ) , this ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } } else { close ( ) ; } if ( _state . isClosed ( ) ) { disconnect ( ) ; } //System.out.println("READ_C: " + code + " " + sb);; }
Read a close frame .