/**
   * Returns an instance of ArtnetController for the given host address and port.
   *
   * @param host host IP for the ArtnetController
   * @param port port for the ArtnetController
   * @return an instance of ArtnetController
   * @throws IOException when the port cannot be opened
   */
  public static ArtnetController getInstance(NetworkAddress host, int port) throws IOException {
    if (host == null) {
      throw new IllegalArgumentException("cannot getInstance of ArtnetController: host is null");
    }
    if (port <= 0) {
      throw new IllegalArgumentException(
          "cannot getInstance of ArtnetController: port has to be greater than 0");
    }

    String identifier = host.getInterfaceAddress().getAddress() + ":" + port;

    if (instances.containsKey(identifier)) {
      return instances.get(identifier);
    } else {
      ArtnetController artnetController = new ArtnetController(host, port);
      instances.put(identifier, artnetController);
      return artnetController;
    }
  }