Package tel.schich.libdatachannel
Class IceUdpMuxListener
java.lang.Object
tel.schich.libdatachannel.IceUdpMuxListener
- All Implemented Interfaces:
AutoCloseable
Accepts incoming ICE connections on one UDP endpoint. Native code retains the
first STUN request while the application decides; packets never pass through Java.
Accepted peers are caller-owned and should be closed before this listener.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSettings returned by application admission.static interfacestatic final classParsed, untrusted metadata from an incoming STUN request.static final classSnapshot of native listener activity. -
Constructor Summary
ConstructorsConstructorDescriptionIceUdpMuxListener(InetAddress bindAddress, int port, int maxPendingRequests, Duration requestTimeout, Executor executor, IceUdpMuxListener.Handler handler) IceUdpMuxListener(InetAddress bindAddress, int port, Executor executor, IceUdpMuxListener.Handler handler) -
Method Summary
Modifier and TypeMethodDescriptionvoidHands every request to the handler again.voidclose()@Nullable Throwablefailure()An admission infrastructure failure, for diagnostics.monitorStun(String serverHost, int serverPort) Starts caller-owned STUN monitoring on this listener's exact native socket.voidsetAdmission(byte[] context, Map<String, byte[]> secretsByUfragPrefix) Drops requests that neither a key nor a peer on this endpoint authenticates, natively and before the handler runs.long[]stats()Deprecated.
-
Constructor Details
-
IceUdpMuxListener
public IceUdpMuxListener(InetAddress bindAddress, int port, Executor executor, IceUdpMuxListener.Handler handler) -
IceUdpMuxListener
public IceUdpMuxListener(InetAddress bindAddress, int port, int maxPendingRequests, Duration requestTimeout, Executor executor, IceUdpMuxListener.Handler handler)
-
-
Method Details
-
failure
An admission infrastructure failure, for diagnostics. -
statistics
-
monitorStun
Starts caller-owned STUN monitoring on this listener's exact native socket. No peer or data channel is created. Close the returned monitor separately; closing this listener leaves its monitor and already accepted peers owned by their callers. -
setAdmission
Drops requests that neither a key nor a peer on this endpoint authenticates, natively and before the handler runs. A request whose local ufrag starts with a key's prefix authenticates with BASE64(HMAC-SHA256(secret, context || local ufrag)[0..24]). Secrets are copied. Limits: 8 keys, 1 to 16 character prefixes, 1 to 64 byte secrets and a 1024 byte context. -
clearAdmission
public void clearAdmission()Hands every request to the handler again. -
stats
Deprecated.Usestatistics()for named counters. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
statistics()for named counters.