Removes a subscriber connection, ensuring that any pending commands get requeued.

        @param connection: The client connection to unsubscribe.
        @type connection: L{coilmq.server.StompConnection}
768078
def disconnect(self, connection):
        
        self.log.debug("Disconnecting %s" % connection)
        if connection in self._pending:
            pending_frame = self._pending[connection]
            self.store.requeue(pending_frame.headers.get(
                'destination'), pending_frame)
            del self._pending[connection]

        for dest in list(self._queues.keys()):
            if connection in self._queues[dest]:
                self._queues[dest].remove(connection)
            if not self._queues[dest]:
                # This won't trigger RuntimeError, since we're using keys()
                del self._queues[dest]
737904
def disconnect(self, connection):
        
        self.log.debug("Disconnecting %s" % connection)
        for dest in list(self._topics.keys()):
            if connection in self._topics[dest]:
                self._topics[dest].remove(connection)
            if not self._topics[dest]:
                # This won't trigger RuntimeError, since we're using keys()
                del self._topics[dest]
1232657
public static void closeQuietly(final Connection connection)
    {
        if (connection != null && connection.isOpen()) {
            try {
                connection.close();
            }
            catch (IOException ioe) {
                LOG.warnDebug(ioe, "While closing connection");
            }
        }
    }
982927
public void connectionDidLeave(final RespokeConnection connection) {
        members.remove(connection);

        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                Listener listener = listenerReference.get();
                if (null != listener) {
                    listener.onLeave(connection, RespokeGroup.this);
                }
            }
        });
    }
980694
public void unsubscribe(final Subscription subscription) {
        for (final ArrayList<Subscription> list : SUBSCRIPTION_MAP.values()) {
            list.remove(subscription);
        }
    }
884696
public static synchronized void clearConnection(String poolName, Object mcp, Object cl, Object connection)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.CLEAR_CONNECTION,
                                      Integer.toHexString(System.identityHashCode(cl)),
                                      Integer.toHexString(System.identityHashCode(connection))));
   }
1312466
public void unsubscribe() {
        final long id = Thread.currentThread().getId();
        queues.remove(id);
        if (subscriberIdentifiers != null) {
            for (Iterator<Entry<Object, Long>> iterator = subscriberIdentifiers.entrySet().iterator(); iterator.hasNext(); ) {
                if (id == iterator.next().getValue()) {
                    iterator.remove();
                    break;
                }
            }
        }
    }
849198
function _subscribeToConnectionEvents(connection, workerName) {
    connection.on('close', errCode => {
      logger.info({ workerName, errCode }, '[AMQP] Connection closing, exiting');
      // The workerConnection isn't working anymore...
      workerConnection = null;
      workers.close();
    });
    connection.on('error', err => {
      logger.error({ err, workerName }, '[AMQP] Connection closing because of an error');
    });
    connection.on('blocked', reason => {
      logger.warn({ reason, workerName }, '[AMQP] Connection blocked');
    });
  }
978347
def release(self, connection):
        
        with self.lock:
            connection.in_use = False
            self.cond.notify_all()
582378
def remove_connection(self, interface1, interface2):
        """"""

        uri = "api/interface/disconnect/%s/%s/" % (interface1, interface2)

        return self.delete(uri)
669842
public void purgeClosedConnection(OutboundConnection connection)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "purgeClosedConnection", connection);
        connection.getConnectionData().getConnectionDataGroup().purgeClosedConnection(connection);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "purgeClosedConnection");
    }
43651
protected void purgeClosedConnection(OutboundConnection connection)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "purgeClosedConnection", connection);
        purge(connection, false, false);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "purgeClosedConnection");
    }
1174146
def disconnect(self, cback, subscribers=None, instance=None):
        
        if subscribers is None:
            subscribers = self.subscribers
        # wrapper
        if self._fdisconnect is not None:
            def _disconnect(cback):
                self._disconnect(subscribers, cback)

            notify = partial(self._notify_one, instance)
            if instance is not None:
                result = self._fdisconnect(instance, cback, subscribers,
                                           _disconnect, notify)
            else:
                result = self._fdisconnect(cback, subscribers, _disconnect,
                                           notify)
            if inspect.isawaitable(result):
                result = pull_result(result)
        else:
            self._disconnect(subscribers, cback)
            result = None
        return result
788596
def remove(self, connection):
        ''''''
        key = (connection.host, connection.port)
        with self._lock:
            found = self._connections.pop(key, None)
        try:
            self.close_connection(found)
        except Exception as exc:
            logger.warn('Failed to close %s: %s', connection, exc)
        return found
1030336
void removeConnectionListener(ConnectionManager cm, ConnectionListener cl)
   {
      if (cmToCl != null && cmToCl.get(cm) != null)
      {
         cmToCl.get(cm).remove(cl);
         clToC.remove(cl);
      }
   }
293778
def unsubscribe(self, connection):
        """"""
        self._subscribed_connections.discard(connection)
        self._last_unsubscribe_time = current_time()
221473
ServerSessionManager unregisterConnection(Connection connection) {
    Iterator<Map.Entry<String, Connection>> iterator = connections.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry<String, Connection> entry = iterator.next();
      if (entry.getValue().equals(connection)) {
        ServerSessionContext session = clients.get(entry.getKey());
        if (session != null) {
          session.setConnection(null);
        }
        iterator.remove();
      }
    }
    return this;
  }