public void shutdown ( ErrorCode statusCode ) throws IOException { synchronized ( writer ) { int lastGoodStreamId ; synchronized ( this ) { if ( shutdown ) { return ; } shutdown = true ; lastGoodStreamId = this . lastGoodStreamId ; } // TODO: propagate exception message into debugData. // TODO: configure a timeout on the reader so that it doesn’t block forever. writer . goAway ( lastGoodStreamId , statusCode , Util . EMPTY_BYTE_ARRAY ) ; } }
Degrades this connection such that new streams can neither be created locally nor accepted from the remote peer . Existing streams are not impacted . This is intended to permit an endpoint to gracefully stop accepting new requests without harming previously established streams .