Class Gateway

java.lang.Object
dev.omega24.upnp4j.gateway.Gateway

public class Gateway extends Object
A gateway that we can connect to
  • Method Details

    • getExternalIP

      public String getExternalIP()
      Gets the external IP of the router
      Returns:
      The external IP of the router
    • getLocalIP

      public String getLocalIP()
      Gets the local IP of the router
      Returns:
      The local IP of the router
    • openPort

      public boolean openPort(int port, Protocol protocol)
      Opens a port using UPnP
      Parameters:
      port - A port in the range of 1-65535
      protocol - The protocol to open the port with
      Returns:
      True if the port was able to open
    • closePort

      public boolean closePort(int port, Protocol protocol)
      Closes a port using UPnP
      Parameters:
      port - A port in the range of 1-65535
      protocol - The protocol to close the port with
      Returns:
      True if the port was able to close
    • isOpen

      public boolean isOpen(int port, Protocol protocol)
      Checks if a port is open
      Parameters:
      port - A port in the range of 1-65535
      protocol - The protocol to check the port with
      Returns:
      True if the port is open