Called when unregistration is complete and the Connection can no
longer be interacted with.

Various error paths fall back to unregistering so it can happen multiple times and is really
annoying. Suppress it here with a flag
344121
void unregistered() {
        try {
            if (!m_alreadyStopped) {
                try {
                    safeStopping();
                } finally {
                    try {
                        m_writeStream.shutdown();
                    } finally {
                        m_readStream.shutdown();
                    }
                }
            }
        } finally {
            networkLog.debug("Closing channel " + m_threadName);
            try {
                m_sc.close();
            } catch (IOException e) {
                networkLog.warn(e);
            }
        }
    }
1095464
@Override
    public void unregisterEndpoint(QName serviceName, String endpointURL)
            throws ServiceLocatorFault, InterruptedExceptionFault {
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Unregistering endpoint " + endpointURL + " for service "
                    + serviceName + "...");
        }
        try {
            initLocator();
            locatorClient.unregister(serviceName, endpointURL);
        } catch (ServiceLocatorException e) {
            ServiceLocatorFaultDetail serviceFaultDetail = new ServiceLocatorFaultDetail();
            serviceFaultDetail.setLocatorFaultDetail(serviceName.toString()
                    + "throws ServiceLocatorFault");
            throw new ServiceLocatorFault(e.getMessage(), serviceFaultDetail);
        } catch (InterruptedException e) {
            InterruptionFaultDetail interruptionFaultDetail = new InterruptionFaultDetail();
            interruptionFaultDetail.setInterruptionDetail(serviceName
                    .toString() + "throws InterruptionFault");
            throw new InterruptedExceptionFault(e.getMessage(),
                    interruptionFaultDetail);
        }
    }
922572
public function unregister()
    {
        if ($this->isRegistered) {
            $this->system->restoreExceptionHandler();
            $this->system->restoreErrorHandler();

            $this->isRegistered = false;
        }

        return $this;
    }
1313319
protected void unregister(IConnection conn, boolean deleteIfNoConns) {
        log.debug("Unregister connection ({}:{}) client id: {}", conn.getRemoteAddress(), conn.getRemotePort(), id);
        // remove connection from connected scopes list
        connections.remove(conn);
        // If client is not connected to any scope any longer then remove
        if (deleteIfNoConns && connections.isEmpty()) {
            // TODO DW dangerous the way this is called from BaseConnection.initialize(). Could we unexpectedly pop a Client out of the registry?
            removeInstance();
        }
    }
1087718
def unregister_a_problem(self, prob):
        
        self.source_problems.remove(prob.uuid)

        # For know if we are still an impact, maybe our dependencies
        # are not aware of the remove of the impact state because it's not ordered
        # so we can just look at if we still have some problem in our list
        if not self.source_problems:
            self.is_impact = False
            # No more an impact, we can unset the impact state
            self.unset_impact_state()

        # And we register a new broks for update status
        self.broks.append(self.get_update_status_brok())
204218
public void unRegisterActivitDestroyedEvent(IActivityDestroyedCallback callback) {
        HMSAgentLog.d("unRegisterOnDestroyed:" + StrUtils.objDesc(callback));
        destroyedCallbacks.remove(callback);
    }
1251612
public static function unregisterInstance(): void
    {
        if (!self::$unregistering && self::$client !== null) {
            self::$unregistering = true;

            if ((self::$client->preparedToSendBuffer ?: '') !== '') {
                self::$client->sendBuffer .= self::$client->preparedToSendBuffer;
            }

            try {
                self::$client->sendBuffer .= self::$client->protocol->getKeepAlive();
                self::$client->protocol->flush();
            } catch (\Throwable $e) {
            }

            // TODO MUST TEST, IT WAS REMOVED FROM FUNCTION
            // BECAUSE IT SIMPLY LOOKS LIKE THE LINES BEFORE
            // ADDED AN IF TO CHECK THE CHANNEL In CASE OF
            //
            if (isset(self::$client->protocol->handler->channel) &&
                false === strpos(get_class(self::getClient()->protocol->handler->channel), '/EmptyChannel/')) {
                try {
                    self::$client->protocol->keepAlive();
                } catch (\Throwable $e) {
                    // silently discard exceptions when unregistering
                }
            }

            self::$client = null;
            self::$instance = null;
            self::$instanceOptionsKey = null;
            self::$unregistering = false;
        }
    }
92983
def unregister(name, server_url):
    '''
    
    '''

    try:
        client, key = _get_session(server_url)
    except Exception as exc:
        err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server_url, exc)
        log.error(err_msg)
        return {name: err_msg}

    systems_list = client.system.getId(key, name)

    if systems_list:
        for system in systems_list:
            out = client.system.deleteSystem(key, system['id'])
            if out == 1:
                return {name: 'Successfully unregistered from {0}'.format(server_url)}
            else:
                return {name: 'Failed to unregister from {0}'.format(server_url)}
    else:
        return {name: 'System does not exist in spacewalk server ({0})'.format(server_url)}
522955
private function unregister() {
        if ($this->db) {
            $this->db->recordset_closed($this);
            $this->db = null;
        }
    }
475447
private synchronized void unregisterAllSimons() {
		Iterator<String> namesIter = registeredNames.iterator();
		while (namesIter.hasNext()) {
			String name = namesIter.next();
			try {
				ObjectName objectName = new ObjectName(name);
				mBeanServer.unregisterMBean(objectName);
				// I have to use iterator.remove() - hence no common method for clearManager() and simonDestroyed(simon)
				namesIter.remove();
				onManagerMessage("Unregistered Simon with the name: " + objectName);
			} catch (JMException e) {
				onManagerWarning("JMX unregistration failed for: " + name, e);
			}
		}
	}
603132
protected void unregisterAllTimeouts() {
		for (Timeout<K> timeout : timeouts.values()) {
			timeout.cancel();
		}
		timeouts.clear();
	}
1021434
def unregisterHandler(self, fh):

        

        try:
            self.fds.remove(fh)

        except KeyError:
            pass

        self.lock.acquire()

        try:
            self.data.rollover() # rollover data on close.

        finally:
            self.lock.release()

        if self.closing and not self.fds:
            self.data.close()
806352
@Invalidate
    public void stop() {
        unregisterConfigurationsExposedAsServices();
        if (registration != null) {
            registration.unregister();
            registration = null;
            try {
                watcher.removeAndStopIfNeeded(configFile.getParentFile());
            } catch (RuntimeException e) { //NOSONAR
                // An exception can be thrown when the platform is shutting down.
                // ignore it.
            }
        }
    }
414330
def connectionLost(self, reason):
        
        if self._disconnectCBs:
            for cb in self._disconnectCBs:
                cb(self, reason)
307139
def unregister_file(path, pkg=None, conn=None):  # pylint: disable=W0612
    '''
    
    '''
    close = False
    if conn is None:
        close = True
        conn = init()

    conn.execute('DELETE FROM files WHERE path=?', (path, ))
    if close:
        conn.close()
1003648
public void unregisterInstance(String serviceName, String instanceId, boolean isOwned){
        String uri = toInstanceUri(serviceName, instanceId) + "/" + isOwned;
        HttpResponse result = invoker.invoke(uri, null,
                HttpMethod.DELETE);

        if (result.getHttpCode() != HTTP_OK) {
            throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }
    }
316354
async def stop(self):
        
        if self._association_state != self.State.CLOSED:
            await self._abort()
        self.__transport._unregister_data_receiver(self)
        self._set_state(self.State.CLOSED)