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


Python Network.getResidenceIp方法代码示例

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


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

示例1: getRooms

# 需要导入模块: import Network [as 别名]
# 或者: from Network import getResidenceIp [as 别名]
 def getRooms(self):
     if (self.ipResidence == None):
         self.ipResidence = util.getResidenceIp()
     if (self.ipResidence != "Residence is offline"):
         tmp = util.httpGetRequest(self.ipResidence, 5432,"getRooms")
         self.rooms = json.loads(tmp).keys()
     else:
         self.ipResidence = None
开发者ID:felipelindemberg,项目名称:ControleMultimidiaUniversal,代码行数:10,代码来源:run.py

示例2: startThreadResidence

# 需要导入模块: import Network [as 别名]
# 或者: from Network import getResidenceIp [as 别名]
 def startThreadResidence(self):
     self.pbar.show()
     self.residenceButton.set_sensitive(False)
     self.pbar.set_text("Iniciando residência")
     status = util.getResidenceIp()
     self.pbar.hide()
     self.clickedResidence = True
     if (status == "Residence is offline"):
         self.residenceButton.set_label("Residência iniciada")
         os.system("python " + os.path.abspath("Residencia/server.py"))
     else:
         self.residenceButton.set_label("Residência iniciada na rede")
开发者ID:felipelindemberg,项目名称:ControleMultimidiaUniversal,代码行数:14,代码来源:run.py

示例3: Connect

# 需要导入模块: import Network [as 别名]
# 或者: from Network import getResidenceIp [as 别名]
 def Connect(self):
     """Método que faz a conexão com Residência
     """
     myIp = util.get_local_ip_address("1.1.1.1")
     print "mayyyyyyyyyyyyyyyyyyyyyyy0",util.get_local_ip_address("1.1.1.1")
     while True:
         port = self.room.getPort()
         if(port != None):
             print ("----------------------------My IP", myIp)
             params = {"nameRoom": self.room.getName(), "ip": myIp, "port": port}
             self.ipResidence = util.getResidenceIp()
             if (self.ipResidence == "Residence is offline"):
                 print "Residence is offline"
                 os._exit(1)
             print "sdssssssssssssss----------_",myIp,params,self.ipResidence
             sucessToCreatComod = util.httpPostRequest(self.ipResidence, 5432, "addRoom", params)
             if(sucessToCreatComod == False):
                 print "Problemas na conexao, tente novamente!"
                 os._exit(1)
             elif (sucessToCreatComod == "Comodo já existe"):
                 print "Nome de room existente, altere-o"
                 os._exit(1)
             break
     self.connected = True 
开发者ID:felipelindemberg,项目名称:ControleMultimidiaUniversal,代码行数:26,代码来源:server.py


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