Class NetherNetHTTPSignaling
java.lang.Object
org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetHTTPSignaling
- All Implemented Interfaces:
AutoCloseable,NetherNetServerSignaling,NetherNetSignaling
This class implements a signaling server using HTTP(S) for the NetherNet protocol.
Follows ...
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forNetherNetHTTPSignaling.static interfaceFunctional interface providing the MOTD returned to clients querying the server.static interfaceFunctional interface for filtering players before a connection is created for them.Nested classes/interfaces inherited from interface org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetServerSignaling
NetherNetServerSignaling.NewConnectionHandler, NetherNetServerSignaling.PongDataNested classes/interfaces inherited from interface org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetSignaling
NetherNetSignaling.IceServerInfo, NetherNetSignaling.SignalHandler -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(SocketAddress localAddress, io.netty.channel.EventLoop eventLoop) Binds the signaling medium to listen for incoming connections (Server mode).voidclose()Closes the signaling channel and releases any associated resources.Returns the Local Network ID of this client as a String.booleanisActive()Whether the signaling is connected and able to carry messagesvoidremoveSignalHandler(long connectionId) Removes the signaling handler for a specific connection ID.voidsendFullSdp(String targetNetworkId, String sdp) Sends a full SDP message with all candidates to the remote peer TODO Find a better nameReturns the identity used to sign SDP answers, or null to have the channel generate an ephemeral one.voidSets the advertisement data for the discovery mechanism (e.g.voidHandler for new connections.voidsetSignalHandler(long connectionId, NetherNetSignaling.SignalHandler handler) Sets a handler to receive signaling messages for a specific connection ID.booleanWhether this signaling can deliver ICE candidates incrementally after the answer has been sent.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetServerSignaling
allowsIceOnLocalPort, getIceServersMethods inherited from interface org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetSignaling
sendSignal
-
Method Details
-
bind
public void bind(SocketAddress localAddress, io.netty.channel.EventLoop eventLoop) throws ConnectException Description copied from interface:NetherNetServerSignalingBinds the signaling medium to listen for incoming connections (Server mode).- Specified by:
bindin interfaceNetherNetServerSignaling- Parameters:
localAddress- The local address to bind to.eventLoop- The owning channel's event loop.- Throws:
ConnectException
-
setNewConnectionHandler
Description copied from interface:NetherNetServerSignalingHandler for new connections.- Specified by:
setNewConnectionHandlerin interfaceNetherNetServerSignaling- Parameters:
handler- Functional interface receiving (ConnectionID, RemoteNetworkID, Payload)
-
setAdvertisementData
Description copied from interface:NetherNetServerSignalingSets the advertisement data for the discovery mechanism (e.g. LAN Pong).- Specified by:
setAdvertisementDatain interfaceNetherNetServerSignaling- Parameters:
pongData- The Pong advertisement data.
-
serverIdentity
Description copied from interface:NetherNetServerSignalingReturns the identity used to sign SDP answers, or null to have the channel generate an ephemeral one.- Specified by:
serverIdentityin interfaceNetherNetServerSignaling- Returns:
- The server identity, or null if this signaling has none
-
usesTrickleIce
public boolean usesTrickleIce()Description copied from interface:NetherNetServerSignalingWhether this signaling can deliver ICE candidates incrementally after the answer has been sent.- Specified by:
usesTrickleIcein interfaceNetherNetServerSignaling- Returns:
- true if candidates are trickled as they are gathered
-
sendFullSdp
Description copied from interface:NetherNetSignalingSends a full SDP message with all candidates to the remote peer TODO Find a better name- Specified by:
sendFullSdpin interfaceNetherNetSignaling- Parameters:
targetNetworkId- The Network ID of the destination (String to support Realms).sdp- The full SDP message with all candidates.
-
setSignalHandler
Description copied from interface:NetherNetSignalingSets a handler to receive signaling messages for a specific connection ID.- Specified by:
setSignalHandlerin interfaceNetherNetSignaling- Parameters:
connectionId- The connection ID to listen for.handler- The handler to process incoming signaling messages.
-
removeSignalHandler
public void removeSignalHandler(long connectionId) Description copied from interface:NetherNetSignalingRemoves the signaling handler for a specific connection ID.- Specified by:
removeSignalHandlerin interfaceNetherNetSignaling- Parameters:
connectionId- The connection ID whose handler should be removed.
-
isActive
public boolean isActive()Description copied from interface:NetherNetSignalingWhether the signaling is connected and able to carry messages- Specified by:
isActivein interfaceNetherNetSignaling
-
getLocalNetworkId
Description copied from interface:NetherNetSignalingReturns the Local Network ID of this client as a String. This is required for formatting the 'candidate:' string in SDP.- Specified by:
getLocalNetworkIdin interfaceNetherNetSignaling
-
close
public void close()Description copied from interface:NetherNetSignalingCloses the signaling channel and releases any associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceNetherNetSignaling
-