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


Python DotXpra.get_server_state方法代码示例

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


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

示例1: create_control_socket

# 需要导入模块: from xpra.dotxpra import DotXpra [as 别名]
# 或者: from xpra.dotxpra.DotXpra import get_server_state [as 别名]
 def create_control_socket(self):
     dotxpra = DotXpra(self.socket_dir)
     name = "proxy-%s" % os.getpid()
     sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir())
     state = dotxpra.get_server_state(sockpath)
     if state in (DotXpra.LIVE, DotXpra.UNKNOWN):
         log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath)
         return False
     try:
         sock = create_unix_domain_socket(sockpath, None)
         sock.listen(5)
     except Exception, e:
         log.warn("failed to setup control socket %s: %s", sockpath, e)
         return False
开发者ID:svn2github,项目名称:Xpra,代码行数:16,代码来源:proxy_instance_process.py

示例2: create_control_socket

# 需要导入模块: from xpra.dotxpra import DotXpra [as 别名]
# 或者: from xpra.dotxpra.DotXpra import get_server_state [as 别名]
 def create_control_socket(self):
     dotxpra = DotXpra(self.socket_dir)
     name = "proxy-%s" % os.getpid()
     sockpath = dotxpra.norm_make_path(name, dotxpra.sockdir())
     state = dotxpra.get_server_state(sockpath)
     if state in (DotXpra.LIVE, DotXpra.UNKNOWN):
         log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath)
         return False
     try:
         sock = create_unix_domain_socket(sockpath, None, 0o600)
         sock.listen(5)
     except:
         log.warn("failed to setup control socket %s", sockpath, exc_info=True)
         return False
     self.control_socket = sock
     self.control_socket_path = sockpath
     log.info("proxy instance now also available using unix domain socket: %s", self.control_socket_path)
     return True
开发者ID:svn2github,项目名称:Xpra,代码行数:20,代码来源:proxy_instance_process.py

示例3: create_control_socket

# 需要导入模块: from xpra.dotxpra import DotXpra [as 别名]
# 或者: from xpra.dotxpra.DotXpra import get_server_state [as 别名]
 def create_control_socket(self):
     assert self.socket_dir
     dotxpra = DotXpra(self.socket_dir)
     sockpath = dotxpra.socket_path(":proxy-%s" % os.getpid())
     state = dotxpra.get_server_state(sockpath)
     if state in (DotXpra.LIVE, DotXpra.UNKNOWN):
         log.warn("You already have a proxy server running at %s, the control socket will not be created!", sockpath)
         return False
     try:
         sock = create_unix_domain_socket(sockpath, None, 0o600)
         sock.listen(5)
     except Exception as e:
         log("create_unix_domain_socket failed for '%s'", sockpath, exc_info=True)
         log.error("Error: failed to setup control socket '%s':", sockpath)
         log.error(" %s", e)
         return False
     self.control_socket = sock
     self.control_socket_path = sockpath
     log.info("proxy instance now also available using unix domain socket:")
     log.info(" %s", self.control_socket_path)
     return True
开发者ID:svn2github,项目名称:Xpra,代码行数:23,代码来源:proxy_instance_process.py


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