예제 #1
0
파일: order_by.py 프로젝트: PayasR/paralite
 def register_to_master(self, cqid, opid, node, port):
     sep = conf.SEP_IN_MSG
     msg = sep.join([conf.REG, conf.DATA_NODE, cqid, opid, gethostname(), str(self.my_port), self.local_addr])
     ParaLiteLog.debug("MASTER_NODE: %s  MASTER_PORT: %s" % (self.master_name, self.master_port))
     addr = (self.master_name, self.master_port)
     sock = socket(AF_INET, SOCK_STREAM)
     try:
         sock.connect(addr)
     except Exception, e:
         ParaLiteLog.error("Error in register_to_master: %s" % traceback.format_exc())
         if e.errno == 4:
             sock.connect(addr)