YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.discovery.SendspinDirectory Class Reference

The Sendspin players the network announced (mDNS _sendspin._tcp), as the last scan left them. More...

Collaboration diagram for de.yaacc.sendspin.discovery.SendspinDirectory:
Collaboration graph

Classes

class  Entry
 A player as announced.
 
interface  Listener
 Told after every change, outside the lock. More...
 

Public Member Functions

 SendspinDirectory (MonotonicClock clock, long graceMillis)
 
void addListener (Listener listener)
 
void removeListener (Listener listener)
 
boolean serviceFound (String serviceId, String serviceName, InetAddress address, int port, SendspinServiceTxt txt)
 
void serviceLost (String serviceId)
 The platform says the service is gone: it is listed for the grace period still.
 
void discoveryRestarted ()
 A new scan starts: what the earlier one found and the new one does not announce again is gone after the grace period (a browse only reports the loss of services it has seen itself).
 
void clear ()
 The scan ended (switched off): what it found is forgotten.
 
List< Entry > snapshot ()
 The players, one per endpoint, sorted by name and address; services past their grace period are dropped first.
 

Static Public Attributes

static final int MAX_DISCOVERED = 32
 
static final int MIN_PORT = 1024
 
static final long DEFAULT_GRACE_MILLIS = 30_000L
 

Detailed Description

The Sendspin players the network announced (mDNS _sendspin._tcp), as the last scan left them.

Announcements are not authenticated, so what is accepted is limited: only addresses of the local network (no loopback, no public address, as for the other discovered devices), a port of 1024 or more, a path that is path-absolute, at most {@value MAX_DISCOVERED} players. A service that disappears stays listed for a grace period (announcements flap), then goes. Pure; the platform calls and the connections are elsewhere. Thread safe; listeners are told outside the lock.

Member Function Documentation

◆ serviceFound()

boolean de.yaacc.sendspin.discovery.SendspinDirectory.serviceFound ( String serviceId,
String serviceName,
InetAddress address,
int port,
SendspinServiceTxt txt )
Returns
true if the announcement was accepted (listed or refreshed)
Here is the call graph for this function:

The documentation for this class was generated from the following file: