src/main/java/com/hibegin/http/server/handler/SSLReadWriteSelectorHandler.java
boolean shutdown() throws IOException {

        if (!shutdown) {
            sslEngine.closeOutbound();
            shutdown = true;
        }

        if (outNetBB.hasRemaining() && tryFlush(outNetBB)) {
            return false;
        }

	/*
     * By RFC 2616, we can "fire and forget" our close_notify
	 * message, so that's what we'll do here.
	 */
        outNetBB.clear();
        SSLEngineResult result = sslEngine.wrap(hsBB, outNetBB);
        if (result.getStatus() != Status.CLOSED) {
            throw new SSLException("Improper close state");
        }
        outNetBB.flip();

	/*
     * We won't wait for a select here, but if this doesn't work,
	 * we'll cycle back through on the next select.
	 */
        if (outNetBB.hasRemaining()) {
            tryFlush(outNetBB);
        }

        return (!outNetBB.hasRemaining() &&
                (result.getHandshakeStatus() != HandshakeStatus.NEED_WRAP));
    }
boolean shutdown() throws IOException {

        if (!shutdown) {
            sslEngine.closeOutbound();
            shutdown = true;
        }

        if (outNetBB.hasRemaining() && tryFlush(outNetBB)) {
            return false;
        }

	/*
     * By RFC 2616, we can "fire and forget" our close_notify
	 * message, so that's what we'll do here.
	 */
        outNetBB.clear();
        SSLEngineResult result = sslEngine.wrap(hsBB, outNetBB);
        if (result.getStatus() != Status.CLOSED) {
            throw new SSLException("Improper close state");
        }
        outNetBB.flip();

	/*
     * We won't wait for a select here, but if this doesn't work,
	 * we'll cycle back through on the next select.
	 */
        if (outNetBB.hasRemaining()) {
            tryFlush(outNetBB);
        }

        return (!outNetBB.hasRemaining() &&
                (result.getHandshakeStatus() != HandshakeStatus.NEED_WRAP));
    }
boolean shutdown ( ) throws IOException { if ( ! shutdown ) { sslEngine . closeOutbound ( ) ; shutdown = true ; } if ( outNetBB . hasRemaining ( ) && tryFlush ( outNetBB ) ) { return false ; } /*
     * By RFC 2616, we can "fire and forget" our close_notify
	 * message, so that's what we'll do here.
	 */ outNetBB . clear ( ) ; SSLEngineResult result = sslEngine . wrap ( hsBB , outNetBB ) ; if ( result . getStatus ( ) != Status . CLOSED ) { throw new SSLException ( "Improper close state" ) ; } outNetBB . flip ( ) ; /*
     * We won't wait for a select here, but if this doesn't work,
	 * we'll cycle back through on the next select.
	 */ if ( outNetBB . hasRemaining ( ) ) { tryFlush ( outNetBB ) ; } return ( ! outNetBB . hasRemaining ( ) && ( result . getHandshakeStatus ( ) != HandshakeStatus . NEED_WRAP ) ) ; }
/*
Begin the shutdown process.
<P>
Close out the SSLEngine if not already done so, then
wrap our outgoing close_notify message and try to send it on.
<P>
Return true when we're done passing the shutdown messsages.
/ * Begin the shutdown process . <P > Close out the SSLEngine if not already done so then wrap our outgoing close_notify message and try to send it on . <P > Return true when we re done passing the shutdown messsages .