Interface NetherNetSignaling

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

public interface NetherNetSignaling extends AutoCloseable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    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 this side is addressed by.
    boolean
    Whether the signaling is connected and able to carry messages
    void
    Removes the signaling handler for a specific connection ID.
    default void
    sendDescription(String targetNetworkId, String sdp)
    Sends a complete session description, every gathered candidate included, to the remote peer.
    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.
    default boolean
    Whether this signaling delivers ICE candidates one by one as they are gathered.
  • Method Details

    • sendSignal

      default void sendSignal(String targetNetworkId, String data)
      Sends a signaling message to the remote peer. Required when usesTrickleIce() is true, which is the default.
      Parameters:
      targetNetworkId - The Network ID of the destination (String to support Realms).
      data - The raw signaling payload.
    • sendDescription

      default void sendDescription(String targetNetworkId, String sdp)
      Sends a complete session description, every gathered candidate included, to the remote peer. This is how a description travels when usesTrickleIce() is false, on either side.
      Parameters:
      targetNetworkId - The Network ID of the destination (String to support Realms).
      sdp - The complete description.
    • usesTrickleIce

      default boolean usesTrickleIce()
      Whether this signaling delivers ICE candidates one by one as they are gathered. Signaling that cannot, such as a single HTTP exchange, receives one sendDescription(java.lang.String, java.lang.String) once gathering is complete and no candidate signals at all.
      Returns:
      true if candidates are trickled as they are gathered
    • setSignalHandler

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

      void removeSignalHandler(String 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 this side is addressed by. A client puts it in its join, a server that is addressed by host name rather than network id, such as HTTP signaling, returns an empty string.
    • 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