Closes an individual connection. Give an optional reason

        :param name: The connection name
        :type name: str

        :param reason: An option reason why the connection was deleted
        :type reason: str
771949
def delete_connection(self, name, reason=None):
        
        headers = {'X-Reason': reason} if reason else {}

        self._api_delete(
            '/api/connections/{0}'.format(
                urllib.parse.quote_plus(name)
            ),
            headers=headers,
        )
1282618
def transport_closed(self, **kwargs):
        
        msg = 'unknown cause'
        self.logger.warning('transport to %s closed : %s' %
                            (self._host, kwargs.get('msg', msg)))
        self._close_info = {
            'reply_code': kwargs.get('reply_code', 0),
            'reply_text': kwargs.get('msg', msg),
            'class_id': kwargs.get('class_id', 0),
            'method_id': kwargs.get('method_id', 0)
        }

        # We're not connected any more, but we're not closed without an
        # explicit close call.
        self._connected = False
        self._transport = None

        # Call back to a user-provided close function
        self._callback_close()
1014008
void closeConnections()
    {
        final String methodName = "closeConnections";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }

        synchronized (_connections)
        {
            Collection<SibRaMessagingEngineConnection> cons = _connections.values();
            Iterator<SibRaMessagingEngineConnection> iter = cons.iterator();
            while (iter.hasNext())
            {
                SibRaMessagingEngineConnection connection = iter.next();
                connection.close();
            }
            _connections.clear();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(TRACE, methodName);
        }
    }
1329520
public void resolutionFailed (Name username, Exception reason)
    {
        if (reason instanceof ClientResolver.ClientDisconnectedException) {
            log.info("Client disconnected during resolution", "who", who());

        } else {
            // urk; nothing to do but complain and get the f**k out of dodge
            log.warning("Unable to resolve client", "who", who(), reason);
        }

        // end the session now to prevent danglage
        endSession();
    }
452469
def close_connection(self):
        
        if self.port:
            self.port.close()
            self.logger.debug("Close TCP port")
669014
@Override
    public void quit(String reason) {
        if (!connected) {
            throw new NotConnectedException();
        }

        Message quit = new Message(MessageType.QUIT, reason);
        ChannelFuture future = connection.send(quit);

        /* Wait for message to be sent and then close the underlying connection */
        future.addListener(new ChannelFutureListener() {
            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
                connection.close();
            }
        });
    }
912188
def connectionLost(self, reason):
        
        self.remaining.reset()

        try:
            result = json.load(self.remaining)
        except Exception, e:
            self.finished.errback(e)
            return

        returnValue = result
        if self.heartbeater:
            self.heartbeater.nextToken = result['token']
            returnValue = (result, self.heartbeater)

        self.finished.callback(returnValue)
39206
def disconnect(self, client):
        
        self.clients.remove(client)
        del self.connect_args[client]
        client.disconnect()
1155036
public static function close($config_name)
    {
        if (isset(self::$instance[$config_name])) {
            self::$instance[$config_name]->closeConnection();
            self::$instance[$config_name] = null;
        }
    }
830136
def connectionLost(self, reason):
        
        self.nexus.conns.connectionLostForKey((endpoint.Q2QEndpoint(
                self.nexus.svc,
                self.nexus.addr,
                self.transport.getQ2QPeer(),
                PROTOCOL_NAME), None))
        AMP.connectionLost(self, reason)
155868
def close_connection (self):
        
        if self.url_connection is None:
            # no connection is open
            return
        try:
            self.url_connection.close()
        except Exception:
            # ignore close errors
            pass
        self.url_connection = None
1234815
def close(self, code: int = None, reason: str = None) -> None:
        
        if self.protocol is not None:
            self.protocol.close(code, reason)
            self.protocol = None
981707
def shutdown(self, reason = ConnectionClosed()):
        
        if self._shutdown:
            raise ShutdownError()
        
        self.stop()
       
        self._closing = True
        for connection in self.connections:
            connection.close()
        self.connections = set()
        self._shutdown = True
        if isinstance(reason, ConnectionClosed):
            logger.info("server shutdown")
        else:
            logger.warn("server shutdown, reason %s" % str(reason))
1134370
function ( name ) {
		// valid connection
		if ( name in pool ) {
			log('ws', 'exit', name, 'close');
			return delete pool[name];
		}

		// failure
		log('ws', 'del', name, 'fail to remove (invalid connection)');
		return false;
	}
374991
async def close_interface_message(self, message, context):
        

        conn_string = message.get('connection_string')
        interface = message.get('interface')
        client_id = context.user_data

        await self.close_interface(client_id, conn_string, interface)
1291057
public void closeConnection(String name) {
    final URI uri = uriWithPath("./connections/" + encodePathSegment(name));
    deleteIgnoring404(uri);
  }
275157
def connectionLost(self, reason):
        
        AMP.connectionLost(self, reason)
        if self.logout is not None:
            self.logout()
            self.boxReceiver = self.logout = None