Class DualStackUtils

java.lang.Object
net.minecraftforge.network.DualStackUtils

public class DualStackUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkIPv6(String hostAddress)
    Resolve the address and see if Java and the OS return an IPv6 or IPv4 one, then let Netty know accordingly (it doesn't understand the java.net.preferIPv6Addresses=system property).
    static boolean
    checkIPv6(InetAddress inetAddress)
    Checks if an address is an IPv6 one or an IPv4 one, lets Netty know accordingly and returns the result.
    Get the device's local IP address, taking into account scenarios where the client's network adapter supports IPv6 and has it enabled but the router's LAN does not.
    static String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DualStackUtils

      public DualStackUtils()
  • Method Details

    • checkIPv6

      public static boolean checkIPv6(String hostAddress)
      Resolve the address and see if Java and the OS return an IPv6 or IPv4 one, then let Netty know accordingly (it doesn't understand the java.net.preferIPv6Addresses=system property).
      Parameters:
      hostAddress - The address you want to check
      Returns:
      true if IPv6, false if IPv4
    • checkIPv6

      public static boolean checkIPv6(InetAddress inetAddress)
      Checks if an address is an IPv6 one or an IPv4 one, lets Netty know accordingly and returns the result.
      Parameters:
      inetAddress - The address you want to check
      Returns:
      true if IPv6, false if IPv4
    • getLocalAddress

      @Nullable public static InetAddress getLocalAddress()
      Get the device's local IP address, taking into account scenarios where the client's network adapter supports IPv6 and has it enabled but the router's LAN does not.
      Returns:
      the client's local IP address or null if unable to determine it
    • getMulticastGroup

      public static String getMulticastGroup()