Interface NetherNetServerSignaling

All Superinterfaces:
AutoCloseable, NetherNetSignaling
All Known Implementing Classes:
AbstractNetherNetXboxSignaling, NetherNetDiscoverySignaling, NetherNetHTTPServerSignaling, NetherNetXboxRpcSignaling, NetherNetXboxSignaling

public interface NetherNetServerSignaling extends NetherNetSignaling
  • Method Details

    • bind

      void bind(SocketAddress localAddress, @Nullable InetSocketAddress iceAddress, io.netty.channel.EventLoop eventLoop) throws ConnectException
      Binds the signaling medium to listen for incoming connections (Server mode).
      Parameters:
      localAddress - The local address to bind to.
      iceAddress - Where ICE binds, on a fixed port shared by every connection, or null when each connection takes a port of its own. A wildcard address gathers on every interface.
      eventLoop - The owning channel's event loop, where new connections are handed over.
      Throws:
      ConnectException - If the signaling cannot bind
    • setNewConnectionHandler

      void setNewConnectionHandler(NetherNetServerSignaling.NewConnectionHandler handler)
      Parameters:
      handler - The handler for new connections
    • setAdvertisementData

      void setAdvertisementData(PongData pongData)
      Sets what this host advertises: the LAN pong for discovery, the status document for HTTP signaling, and nothing for signaling that advertises elsewhere.
      Parameters:
      pongData - The advertisement.
    • setMetrics

      default void setMetrics(@Nullable NetherServerMetrics metrics)
      Sets where to report joins this signaling turns away. Signaling that refuses nothing of its own ignores it.
      Parameters:
      metrics - The metrics to report to, or null to report nothing.
    • getIceServers

      default List<IceServerInfo> getIceServers()
      Returns the ICE servers (STUN/TURN) obtained from the signaling handshake, which every connection gathers through. Returns empty list if none available or not applicable. Servers of the host's own go in NetherChannelOption.NETHER_PEER_CONNECTION_CONFIG.
    • serverIdentity

      default OperatorIdentity serverIdentity()
      Returns the identity used to sign SDP answers, or null to have each server channel generate one of its own under the domain self, which is then what players see in the trust prompt and which changes on every start.
      Returns:
      The server identity, or null if this signaling has none
    • allowsIceOnLocalPort

      default boolean allowsIceOnLocalPort()
      Whether ICE may bind to the address the channel was bound to, instead of an ephemeral port.
      Returns:
      true if ICE should be pinned to the bound address
    • setMediaRelayed

      default void setMediaRelayed(boolean relayed)
      Called by the server channel before bind(java.net.SocketAddress, java.net.InetSocketAddress, io.netty.channel.EventLoop) when PROXY protocol relays front its media port. Signaling without relay support refuses.
      Parameters:
      relayed - Whether the media is only reached through relays
      Throws:
      UnsupportedOperationException - If relayed, by default