Calls {@link ChannelHandlerContext#disconnect(ChannelPromise)} to forward
to the next {@link ChannelOutboundHandler} in the {@link ChannelPipeline}.

Sub-classes may override this method to change behavior.
169514
@Skip
    @Override
    public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise)
            throws Exception {
        ctx.disconnect(promise);
    }
775968
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame) {
        if (channel == null) {
            throw new NullPointerException("channel");
        }
        return close(channel, frame, channel.newPromise());
    }
409332
@Override
    public Future<Void> destroy(final Channel channel, final Promise<Void> promise) {
        channel.close().addListener(new PromiseNotifier<>(promise));
        return promise;
    }
588359
public ChannelFuture handshake(Channel channel) {
        if (channel == null) {
            throw new NullPointerException("channel");
        }
        return handshake(channel, channel.newPromise());
    }
1277045
public void disconnect(Destination d) throws KNXLinkClosedException
	{
		if (detached)
			throw new KNXIllegalStateException("TL detached");
		if (d.getState() != Destination.DESTROYED
			&& d.getState() != Destination.DISCONNECTED)
			disconnectIndicate(getProxy(d), true);
	}
1264873
@SuppressWarnings("PMD.UseVarargs")
    /* default */ void dispatch(EventPipeline pipeline,
            EventBase<?> event, Channel[] channels) {
        HandlerList handlers = getEventHandlers(event, channels);
        handlers.process(pipeline, event);
    }
335850
public void disconnect() {
        if (readyState == ReadyState.OPEN) {
            // readyState should be set to ReadyState.CLOSED ONLY AFTER the
            // the WebSocket has been successfully closed in
            // socketClosedHandler().
            this.closeConnection(0, "", 0, 0, null, null);
        } else if (readyState == ReadyState.CONNECTING) {
            socketClosedHandler();
        }
    }
1371522
public synchronized void disconnect() {
    if (mConnected) {
      Preconditions.checkNotNull(mChannel, PreconditionMessage.CHANNEL_NULL_WHEN_CONNECTED);
      LOG.debug("Disconnecting from the {} @ {}", getServiceName(), mAddress);
      beforeDisconnect();
      mChannel.shutdown();
      mConnected = false;
      afterDisconnect();
    }
  }
397463
public void destroy(Exception e) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Destroying this outbound link: " + this + " " + getVirtualConnection());
        }
        // if this object is not active, then just return out
        if (!this.reconnecting) {
            synchronized (this) {
                if (!this.bIsActive) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Ignoring destroy on an inactive object");
                    }
                    return;
                }
                this.bIsActive = false;
            }
            super.destroy(e);
            if (null != this.myInterface) {
                this.myInterface.destroy();
                this.myInterface = null;
            }
            // 342859 - disconnect from these objects too
            this.targetAddress = null;
            this.myChannel = null;
        } else {
            // this connection is now toast...need to tell that to the
            // channel above.
            this.earlyReconnectDestroy = true;
            IOException ioe = this.reconnectException;
            this.reconnectException = null;
            this.reconnecting = false;
            this.myInterface.callErrorCallback(getVirtualConnection(), ioe);
        }
    }
1354080
void closeChannel(final Channel channel) {
        synchronized (channelClosing) {
            if (closingChannel.contains(channel)) {
                LOG.info(channel.toString() + " has already been closed");
                return;
            }

            closingChannel.add(channel);
        }

        LOG.debug(channel.toString() + " begin to close");
        ChannelFuture closeFuture = channel.close();
        closeFuture.addListener(new ChannelFutureListener() {
            public void operationComplete(ChannelFuture future) throws Exception {

                synchronized (channelClosing) {
                    closingChannel.remove(channel);
                }
                LOG.debug(channel.toString() + " closed.");
            }
        });
    }
633669
public void disconnectEnd() {
		if (this.endPoint != null) {
			this.endPoint.remove(this);
		}
		this.endPoint = new SGraphPoint(getGraph());
		this.endPoint.add(this);
	}
651614
protected int disconnect(final boolean iForceDirty, final int iLevel) {
    if (dataProvider == null)
      // DIRTY NODE, JUST REMOVE IT
      return 1;

    int totalDisconnected = 0;

    final ORID rid = dataProvider.getIdentity();

    boolean disconnectedFromParent = false;
    if (parent != null) {
      // DISCONNECT RECURSIVELY THE PARENT NODE
      if (canDisconnectFrom(parent) || iForceDirty) {
        if (parent.left == this) {
          parent.left = null;
        } else if (parent.right == this) {
          parent.right = null;
        } else
          OLogManager.instance().warn(this,
              "Node " + rid + " has the parent (" + parent + ") unlinked to itself. It links to " + parent);

        totalDisconnected += parent.disconnect(iForceDirty, iLevel + 1);
        parent = null;
        disconnectedFromParent = true;
      }
    } else {
      disconnectedFromParent = true;
    }

    boolean disconnectedFromLeft = false;
    if (left != null) {
      // DISCONNECT RECURSIVELY THE LEFT NODE
      if (canDisconnectFrom(left) || iForceDirty) {
        if (left.parent == this)
          left.parent = null;
        else
          OLogManager.instance().warn(this,
              "Node " + rid + " has the left (" + left + ") unlinked to itself. It links to " + left.parent);

        totalDisconnected += left.disconnect(iForceDirty, iLevel + 1);
        left = null;
        disconnectedFromLeft = true;
      }
    } else {
      disconnectedFromLeft = true;
    }

    boolean disconnectedFromRight = false;
    if (right != null) {
      // DISCONNECT RECURSIVELY THE RIGHT NODE
      if (canDisconnectFrom(right) || iForceDirty) {
        if (right.parent == this)
          right.parent = null;
        else
          OLogManager.instance().warn(this,
              "Node " + rid + " has the right (" + right + ") unlinked to itself. It links to " + right.parent);

        totalDisconnected += right.disconnect(iForceDirty, iLevel + 1);
        right = null;
        disconnectedFromRight = true;
      }
    } else {
      disconnectedFromLeft = true;
    }

    if (disconnectedFromParent && disconnectedFromLeft && disconnectedFromRight)
      if ((!dataProvider.isEntryDirty() && !dataProvider.getIdentity().isTemporary() || iForceDirty)
          && !pTree.isNodeEntryPoint(this)) {
        totalDisconnected++;
        pTree.removeNodeFromMemory(this);
        clear();
      }

    return totalDisconnected;
  }
276457
protected void disconnect()
    {
        if (localWrapperProxyState != null) // F58064
        {
            localWrapperProxyState.disconnect();
        }

        if (ivBusinessLocalWrapperProxyStates != null) // F58064
        {
            for (WrapperProxyState state : ivBusinessLocalWrapperProxyStates)
            {
                state.disconnect();
            }
        }

        if (ivRemoteObjectWrapper != null)
        { // synchronized on the remote Wrapper to set the isRemoteRegistered flag
            synchronized (ivRemoteObjectWrapper)
            {
                if (isRemoteRegistered)
                {
                    try
                    {
                        // @PQ98903A
                        // On zOS even though we don't call the object
                        // adapter to register the servant, we need
                        // to call it to unregister it if the wrapper
                        // is connected to the ORB (i.e. it has a Tie).
                        if ((!isZOS) || (ivRemoteObjectWrapper.intie != null)) // @PQ98903C
                        {
                            ivRemoteObjectWrapper.container.getEJBRuntime().unregisterServant(ivRemoteObjectWrapper);
                        }
                        isRemoteRegistered = false;
                    } catch (Exception ex)
                    {
                        FFDCFilter.processException(ex, CLASS_NAME +
                                                        ".unregisterServant",
                                                    "207", this);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                        {
                            Tr.event(tc, "Failed to unregister wrapper instance",
                                     new Object[] { ivRemoteObjectWrapper, ex });
                        }
                    }
                }
            }
        }

        // d416391 start
        // Unregister any BusinessRemoteWrapper objects that are registered with ORB.
        if (ivBusinessRemote != null) // d416391 d424839
        {
            int numWrappers = ivBusinessRemote.length;
            for (int i = 0; i < numWrappers; ++i)
            {
                BusinessRemoteWrapper wrapper = ivBusinessRemote[i];
                synchronized (wrapper)
                {
                    if (ivBusinessRemoteRegistered[i])
                    {
                        try
                        {
                            // On zOS even though we don't call the object adapter to register
                            // the servant, we need to call it to unregister it if the wrapper
                            // is connected to the ORB (i.e. it has a Tie).
                            if ((!isZOS) || (wrapper.intie != null))
                            {
                                wrapper.container.getEJBRuntime().unregisterServant(wrapper);
                            }
                            ivBusinessRemoteRegistered[i] = false;
                        } catch (Throwable ex)
                        {
                            FFDCFilter.processException(ex, CLASS_NAME + ".unregisterServant",
                                                        "516", this);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                            {
                                Tr.event(tc, "Failed to unregister wrapper instance",
                                         new Object[] { wrapper, ex });
                            }
                        }
                    }
                } // end synchronized
            } // end for
        } // d416391 end
    }
1258364
private void disconnect(ZMQ.Socket socket, String eventName){
        String   endpoint = getConnectedEndPoint(eventName);
        if (endpoint!=null) {
            EventList eventList = connectedMap.get(endpoint);
            if (eventList!=null) {
                socket.unsubscribe(eventName.getBytes());
                traceZmqSubscription(eventName, false);
                eventList.remove(eventName);
                if (eventList.size()==0) {
                    socket.disconnect(endpoint);
                    connectedMap.remove(endpoint);
                }
            }
        }
    }
376428
@Override
	public final Promise disconnect() {
		if (client != null) {
			client.close();
			client = null;
		} else if (clusteredClient != null) {
			clusteredClient.close();
			clusteredClient = null;
		}
		return super.disconnect();
	}
1107063
@Override
    public final void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
        try {
            onChannelReadComplete(ctx);
        } finally {
            parentReadInProgress = false;
            tail = head = null;
            // We always flush as this is what Http2ConnectionHandler does for now.
            flush0(ctx);
        }
        channelReadComplete0(ctx);
    }
532379
protected void disconnect() {
        disconnect0(connectedAddress.holder().getFamily());
        connected = false;
        connectedAddress = null;
        connectedPort = -1;
    }