code: def connect(port=8813, numRetries=10, host="localhost", proc=None):
      
      for wait in range(1, numRetries + 2):
          try:
              return Connection(host, port, proc)
          except socket.error as e:
              print("Could not connect to TraCI server at %s:%s" %
                    (host, port), e)
              if wait < numRetries + 1:
                  print(" Retrying in %s seconds" % wait)
                  time.sleep(wait)
      raise FatalTraCIError(str(e))
docs: Establish a connection to a TraCI-Server and return the
      connection object. The connection is not saved in the pool and not
      accessible via traci.switch. It should be safe to use different
      connections established by this method in different threads.