本文整理匯總了Python中cpc.util.conf.server_conf.ServerConf.toString方法的典型用法代碼示例。如果您正苦於以下問題:Python ServerConf.toString方法的具體用法?Python ServerConf.toString怎麽用?Python ServerConf.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cpc.util.conf.server_conf.ServerConf
的用法示例。
在下文中一共展示了ServerConf.toString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: shutdown_request
# 需要導入模塊: from cpc.util.conf.server_conf import ServerConf [as 別名]
# 或者: from cpc.util.conf.server_conf.ServerConf import toString [as 別名]
def shutdown_request(self,request):
if(hasattr(request,"revertSocket") and request.revertSocket==True):
node = ServerConf().getNodes().get(request.serverId)
request = self.wrapHttpsConnectionWithCertReq(request)
ServerConnectionPool().putConnection(request,node)
node.addOutboundConnection()
log.log(cpc.util.log.TRACE,"Socket not closed, "
"saved as persistent outgoing"
" connection")
else:
#This is how we distinguish socket that comes from a server
if(hasattr(request,"serverId")):
node = ServerConf().getNodes().get(request.serverId)
node.reduceInboundConnection()
log.log(cpc.util.log.TRACE,"Closing socket for %s "%node.toString())
SocketServer.TCPServer.shutdown_request(self,request)