Interface NetherNetSignaling

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
NetherNetClientSignaling, NetherNetServerSignaling
All Known Implementing Classes:
AbstractNetherNetXboxSignaling, NetherNetDiscoverySignaling, NetherNetHTTPSignaling, NetherNetXboxRpcSignaling, NetherNetXboxSignaling

public interface NetherNetSignaling extends AutoCloseable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Data structure for ICE server information.
    static interface 
    Functional interface for handling incoming signals.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the signaling channel and releases any associated resources.
    Returns the Local Network ID of this client as a String.
    boolean
    Whether the signaling is connected and able to carry messages
    void
    removeSignalHandler(long connectionId)
    Removes the signaling handler for a specific connection ID.
    default void
    sendFullSdp(String targetNetworkId, String sdp)
    Sends a full SDP message with all candidates to the remote peer TODO Find a better name
    default void
    sendSignal(String targetNetworkId, String data)
    Sends a signaling message to the remote peer.
    void
    Sets a handler to receive signaling messages for a specific connection ID.
  • Method Details

    • sendSignal

      default void sendSignal(String targetNetworkId, String data)
      Sends a signaling message to the remote peer.
      Parameters:
      targetNetworkId - The Network ID of the destination (String to support Realms).
      data - The raw signaling payload.
    • sendFullSdp

      default void sendFullSdp(String targetNetworkId, String sdp)
      Sends a full SDP message with all candidates to the remote peer TODO Find a better name
      Parameters:
      targetNetworkId - The Network ID of the destination (String to support Realms).
      sdp - The full SDP message with all candidates.
    • setSignalHandler

      void setSignalHandler(long connectionId, NetherNetSignaling.SignalHandler handler)
      Sets a handler to receive signaling messages for a specific connection ID.
      Parameters:
      connectionId - The connection ID to listen for.
      handler - The handler to process incoming signaling messages.
    • removeSignalHandler

      void removeSignalHandler(long connectionId)
      Removes the signaling handler for a specific connection ID.
      Parameters:
      connectionId - The connection ID whose handler should be removed.
    • getLocalNetworkId

      String getLocalNetworkId()
      Returns the Local Network ID of this client as a String. This is required for formatting the 'candidate:' string in SDP.
    • isActive

      boolean isActive()
      Whether the signaling is connected and able to carry messages
    • close

      void close()
      Closes the signaling channel and releases any associated resources.
      Specified by:
      close in interface AutoCloseable