Class SocketUtil$

java.lang.Object
org.apache.pekko.testkit.SocketUtil$

public class SocketUtil$ extends Object
Utilities to get free socket address.
  • Field Details

    • MODULE$

      public static final SocketUtil$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • SocketUtil$

      public SocketUtil$()
  • Method Details

    • RANDOM_LOOPBACK_ADDRESS

      public String RANDOM_LOOPBACK_ADDRESS()
    • temporaryLocalPort

      public int temporaryLocalPort(boolean udp)
      Returns:
      A port on 'localhost' that is currently available
    • temporaryLocalPort

      public int temporaryLocalPort(SocketUtil.Protocol protocol)
      Find a free local post on 'localhost' that is available on the given protocol If both UDP and TCP need to be free specify Both
    • temporaryLocalPort$default$1

      public boolean temporaryLocalPort$default$1()
    • temporaryServerAddress

      public InetSocketAddress temporaryServerAddress(String address, boolean udp)
      Parameters:
      address - host address. If not set, a loopback IP from the 127.20.0.0/16 range is picked
      udp - if true, select a port that is free for running a UDP server. Otherwise TCP.
      Returns:
      an address (host+port) that is currently available to bind on
    • temporaryServerAddress$default$1

      public String temporaryServerAddress$default$1()
    • temporaryServerAddress$default$2

      public boolean temporaryServerAddress$default$2()
    • temporaryServerAddresses

      public scala.collection.immutable.IndexedSeq<InetSocketAddress> temporaryServerAddresses(int numberOfAddresses, String hostname, boolean udp)
    • temporaryServerAddresses$default$2

      public String temporaryServerAddresses$default$2()
    • temporaryServerAddresses$default$3

      public boolean temporaryServerAddresses$default$3()
    • temporaryServerHostnameAndPort

      public scala.Tuple2<String,Object> temporaryServerHostnameAndPort(String interface_)
    • temporaryServerHostnameAndPort$default$1

      public String temporaryServerHostnameAndPort$default$1()
    • temporaryUdpIpv6Port

      public int temporaryUdpIpv6Port(NetworkInterface iface)
    • notBoundServerAddress

      public InetSocketAddress notBoundServerAddress(String address)
    • notBoundServerAddress

      public InetSocketAddress notBoundServerAddress()