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

Turns the endpoint of a snapserver into the InetAddress a connection uses. More...

Collaboration diagram for de.yaacc.multiroom.discovery.Resolver:
Collaboration graph

Classes

interface  Lookup
 The lookup of a name; InetAddress#getByName in the app, a fake in a test. More...
 

Public Member Functions

 Resolver (Lookup lookup, long timeoutMillis)
 
InetAddress resolve (ServerEndpoint endpoint) throws IOException
 

Static Public Member Functions

static Resolver system ()
 The resolver of the app: the system's name lookup with a limit of 5 seconds.
 

Detailed Description

Turns the endpoint of a snapserver into the InetAddress a connection uses.

A discovered server and an IP literal have their address already and are never looked up. A host name (a manual entry) goes to the system resolver, which has no time limit of its own: here the lookup runs on a helper thread and the caller waits at most timeoutMillis, so the reader thread of a connection is never held by a slow or hanging resolver. At most MAX_HELPERS lookups are under way at once (a hanging one keeps its thread until the resolver returns); more are refused at once, so repeated attempts cannot pile up threads. An answer that is unspecified or multicast is refused. Errors carry no host name or address in their text.

Member Function Documentation

◆ resolve()

InetAddress de.yaacc.multiroom.discovery.Resolver.resolve ( ServerEndpoint endpoint) throws IOException
Returns
the address to connect to
Exceptions
IOExceptionwhen the name does not resolve in time, the resolver is busy, or the address is unusable

Referenced by de.yaacc.fcast.discovery.FCastHub.newAddReceiver(), and de.yaacc.snapcast.ResolvingTransport.open().

Here is the caller graph for this function:

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