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();
  }
}

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 ( ) ; } }
read a close frame .
