当前位置: 首页>>代码示例>>Python>>正文


Python protocol.connectionDone方法代码示例

本文整理汇总了Python中twisted.internet.protocol.connectionDone方法的典型用法代码示例。如果您正苦于以下问题:Python protocol.connectionDone方法的具体用法?Python protocol.connectionDone怎么用?Python protocol.connectionDone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.internet.protocol的用法示例。


在下文中一共展示了protocol.connectionDone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """Handle a disconnect from a client.
        """
        super().connectionLost(reason)
        session = self._session
        if session is not None:
            _LOGGER.info('Terminating session %08x', session['id'])
            _utils.wg_dev_delete(session['interface'])
            session_name = _session_fname(session)
            session_network = self._networks[session['network']]
            session_network['pool'].free(
                owner=session_name,
                owned_ip=session['client_ip']
            )
            fs.rm_safe(
                os.path.join(self._sessions_dir, session_name)
            )
            self._session = None 
开发者ID:Morgan-Stanley,项目名称:treadmill,代码行数:20,代码来源:policy_server.py

示例2: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """Override Protocol.connectionLost."""
        LOG.w("Connection lost:", self.handle)
        try:
            self.ping_timeout.cancel()
        except Exception:
            pass
        try:
            self.ping_timer.cancel()
        except Exception:
            pass
        if self.handle in exchange.known_clients:
            exchange.client_disconnected(self.handle) 
开发者ID:epoptes,项目名称:epoptes,代码行数:15,代码来源:bashplex.py

示例3: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        self.factory._connectionLost(reason)
        self.factory = None 
开发者ID:ciena,项目名称:afkak,代码行数:5,代码来源:_protocol.py

示例4: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        self.disconnected = reason
        self._log.debug("Server connection lost: {reason}", reason=reason) 
开发者ID:ciena,项目名称:afkak,代码行数:5,代码来源:endpoints.py

示例5: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """
        We are no longer connected
        """
        self.setTimeout(None)
        self.mailFile = None 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:8,代码来源:smtp.py

示例6: loseConnection

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def loseConnection(self):
        self.proto.connectionLost(protocol.connectionDone) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:4,代码来源:session.py

示例7: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        self.factory.unregister(self) 
开发者ID:OpenBazaar,项目名称:OpenBazaar-Server,代码行数:4,代码来源:ws.py

示例8: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        """
        :param reason: reason for disconnection.
        """
        self.observer.onDisconnection(reason) 
开发者ID:GoSecure,项目名称:pyrdp,代码行数:7,代码来源:tcp.py

示例9: connection_lost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connection_lost(self, exception=connectionDone):
        """
        :param exception: reason for disconnection.
        """
        self.observer.onDisconnection(exception) 
开发者ID:GoSecure,项目名称:pyrdp,代码行数:7,代码来源:tcp.py

示例10: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        abstract.FileDescriptor.connectionLost(self, reason)
        if self.fd is not None:
            os.close(self.fd)
            self.fd = None
        return self.protocol.connectionLost(reason) 
开发者ID:svpcom,项目名称:wifibroadcast,代码行数:8,代码来源:tuntap.py

示例11: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=connectionDone):
        logger.debug('%s disconnected. remainder connected: %d', self.peer, self.factory.num_connections)

        self.factory.remove_connection(self)
        if self.peer_manager:
            self.peer_manager.remove_channel(self) 
开发者ID:theQRL,项目名称:QRL,代码行数:8,代码来源:p2pprotocol.py

示例12: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """We are no longer connected"""
        self.setTimeout(None)
        self.mailFile = None 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:6,代码来源:smtp.py

示例13: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        wlog("INFO", "Lost IRC connection to: " + str(self.hostname)
            + " . Should reconnect automatically soon.")
        if self.wrapper.on_disconnect:
            reactor.callLater(0.0, self.wrapper.on_disconnect, self.wrapper)
        return irc.IRCClient.connectionLost(self, reason) 
开发者ID:JoinMarket-Org,项目名称:joinmarket-clientserver,代码行数:8,代码来源:irc.py

示例14: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """Callback invoked on connection lost."""
        _LOGGER.info('connection lost') 
开发者ID:Morgan-Stanley,项目名称:treadmill,代码行数:5,代码来源:peercredprotocol.py

示例15: connectionLost

# 需要导入模块: from twisted.internet import protocol [as 别名]
# 或者: from twisted.internet.protocol import connectionDone [as 别名]
def connectionLost(self, reason=protocol.connectionDone):
        """Callback invoked on connection lost."""
        _LOGGER.info('connection lost')
        self._ctx = None 
开发者ID:Morgan-Stanley,项目名称:treadmill,代码行数:6,代码来源:lineserver.py


注:本文中的twisted.internet.protocol.connectionDone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。