Class StunUdpMuxMonitor

java.lang.Object
tel.schich.libdatachannel.StunUdpMuxMonitor
All Implemented Interfaces:
AutoCloseable

public final class StunUdpMuxMonitor extends Object implements AutoCloseable
Owns native STUN discovery on a shared UDP socket without a remote ICE peer, DTLS connection or data channel. Native code owns refresh scheduling. Prefer IceUdpMuxListener.monitorStun(String, int) to inherit the exact listener binding. Closing this monitor leaves other socket owners operational.
  • Constructor Details

    • StunUdpMuxMonitor

      public StunUdpMuxMonitor(@Nullable InetAddress bindAddress, int localPort, String serverHost, int serverPort)
      The bind address (including wildcard spelling) and fixed port must match the existing mux owner exactly. Null selects libjuice's wildcard binding. Server hostnames are resolved by native code once per monitor; numeric addresses permit explicit per-family selection by the caller.
  • Method Details

    • binding

      public Optional<StunBinding> binding(int index)
      Copies one resolved-server observation atomically. Empty means the index is not resolved/available; it does not distinguish resolving from failure. Indices remain stable for this monitor. No packets are sent by this call.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable