Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def waitForService(ip, port, retries=60):      
  while retries >= 0:
    try:        
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.settimeout(1)
        s.connect((ip, port))
        s.close()
        break
    except:
      time.sleep(0.5)
      retries = retries - 1
      continue
    
  return retries
        


src/m/a/maestro-HEAD/maestro/service.py   maestro(Download)
    utils.status('Starting %s: waiting for service %s on ip %s and port %s' % (container, service, service_ip, port))
 
    result = utils.waitForService(service_ip, int(port), wait_time)
    if result < 0:
      utils.status('Never found service %s on port %s' % (service, port))

src/d/o/dockermix-HEAD/dockermix/dockermix.py   dockermix(Download)
    self.log.info('Starting %s: waiting for service %s on ip %s and port %s', container, service, service_ip, port)            
 
    result = utils.waitForService(service_ip, int(port), wait_time)
    if result < 0:
      self.log.error('Never found service %s on port %s', service, port)