Unbinds this connection from queue and topic managers (freeing up resources)
        and resets state.
348183
def unbind(self):
        
        self.connected = False
        self.queue_manager.disconnect(self.connection)
        self.topic_manager.disconnect(self.connection)
805534
protected void clear() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Clearing the outbound link: " + this + " " + getVirtualConnection());
        }
        // reset the retry flag based on the config
        setEnableReconnect(this.myChannel.getHttpConfig().allowsRetries());
        setAllowReconnect(true);
        this.reconnecting = false;
        this.reconnectException = null;
        this.earlyReconnectDestroy = false;
    }
94236
def reset(self):
        
        # Kill old connection
        self.quit()
        # Clear chrome configs
        self.opts = webdriver.ChromeOptions()
        # Create new web driver
        self._create_session()
1246969
public function unbind()
    {
        $this->_setErrorHandler();
        ldap_unbind($this->_connection);
        $this->_unsetErrorHandler();

        $this->_connection = null;
    }
1250204
public void unregister() {
        // clean up the connections by first closing them
        for (WebSocketConnection conn : conns) {
            conn.close();
        }
        conns.clear();
        // clean up the listeners by first stopping them
        for (IWebSocketDataListener listener : listeners) {
            listener.stop();
        }
        listeners.clear();
    }
9818
protected void unsetReady()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "unsetReady", this);

        //set the ready state
        _ready = false;

        if (_keyGroup != null)
            _keyGroup.groupNotReady();

        // if consumerKey is null then it can't be already in ready state!
        if (_consumerKey != null)
        {
            //tell the consumerDispatcher that we are no longer ready
            _consumerKey.notReady();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "unsetReady");
    }
676802
def purge(self, connection):
        """"""
        self._checkpid()
        if connection.pid == self.pid:
            idx = connection._pattern_idx
            if connection in self._in_use_connections[idx]:
                self._in_use_connections[idx].remove(connection)
            else:
                self._available_connections[idx].remove(connection)
            connection.disconnect()
910152
def _cleanupConnections(senderkey, signal):
    """"""
    try:
        receivers = connections[senderkey][signal]
    except:
        pass
    else:
        if not receivers:
            # No more connected receivers. Therefore, remove the signal.
            try:
                signals = connections[senderkey]
            except KeyError:
                pass
            else:
                del signals[signal]
                if not signals:
                    # No more signal connections. Therefore, remove the sender.
                    _removeSender(senderkey)
8617
void release() {
		if (mCurrentRequests != null) {
			synchronized (mCurrentRequests) {
				mCurrentRequests.clear();
				mCurrentRequests = null;
			}
		}

		if (mDownloadQueue != null) {
			mDownloadQueue = null;
		}

		if (mDownloadDispatchers != null) {
			stop();

			for (int i = 0; i < mDownloadDispatchers.length; i++) {
				mDownloadDispatchers[i] = null;
			}
			mDownloadDispatchers = null;
		}

	}
619123
protected void removeCleanupAndDestroyAllFreeConnections() { // removed iterator code
        // This method is called within a synchronize block
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "removeCleanupAndDestroyAllFreeConnections");
        }
        int mcWrapperListIndex = mcWrapperList.size() - 1;
        for (int i = mcWrapperListIndex; i >= 0; --i) {
            MCWrapper mcw = (MCWrapper) mcWrapperList.remove(i);
            mcw.setPoolState(0);
            --numberOfConnectionsAssignedToThisFreePool;
            cleanupAndDestroyMCWrapper(mcw);
            pm.totalConnectionCount.decrementAndGet();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "removeCleanupAndDestroyAllFreeConnections");
        }
    }
486396
synchronized void clearInstance() {
		for (ServerSocket next : myControlSockets) {
			ourLog.info("Releasing control port: {}", next.getLocalPort());
			try {
				next.close();
			} catch (IOException theE) {
				// ignore
			}
		}
		myControlSockets.clear();
		myCurrentControlSocketPort = null;
	}
1167031
private void removeConnectionCallbacks() {
        connection.removeSyncStanzaListener(messageListener);
        if (messageCollector != null) {
            messageCollector.cancel();
            messageCollector = null;
        }
    }
1157739
private void removeConnectionCallbacks() {
        connection.removeSyncStanzaListener(messageListener);
        connection.removeSyncStanzaListener(presenceListener);
        connection.removeSyncStanzaListener(subjectListener);
        connection.removeSyncStanzaListener(declinesListener);
        connection.removeStanzaInterceptor(presenceInterceptor);
        if (messageCollector != null) {
            messageCollector.cancel();
            messageCollector = null;
        }
    }
1229632
@Override
    @Trivial
    public void cleanUpState(VirtualConnection vc) {
        vc.getStateMap().remove(HttpDispatcherLink.LINK_ID);
    }
2113
void cleanup() throws IOException {
    serverSocket.close();
    try {
      downlink.close();
    } catch (InterruptedException ie) {
      Thread.currentThread().interrupt();
    }      
  }
634836
@Override
    public void free() {
        try {
        if(hasCoreConnection()) {
            this.getCoreConnection().close();
        }
        this.fireConnectionFreed();
        this.boundThreadId= Thread.currentThread().getId();

    } finally {
        this.setClosed(true);
        // state may be important for State-Listener, so its set after the listener did their work
        setTransactionalData(false);

        // re-opem is not possible
        // this.connection=null;
        this.releaseThreadBinding();
    }

    }
666884
public synchronized void shutdown() {
    if (isActive()) {
      // mark this as no longer running
      setActive(false);
    
      if (topicConnection != null) {
        try {
          topicConnection.close();
        } catch (Exception e) {
          // do nothing
        }
        topicConnection = null;
      }
    }
  }