YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.server.ControlServer Class Reference

The control port of the built-in server (issue #330, task 3.2), by default 1705: the listener, the filter of addresses (rule S2, nothing is read before it passed), at most maxConnections at a time (S3), and the hub that sends notifications to the open connections. More...

Inheritance diagram for de.yaacc.snapcast.server.ControlServer:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.server.ControlServer:
Collaboration graph

Public Member Functions

 ControlServer (SnapcastServer server, Predicate< InetAddress > accept, int maxConnections)
 
 ControlServer (SnapcastServer server, Predicate< InetAddress > accept, int maxConnections, java.util.function.Supplier< String > defaultCodec)
 
void setOnChange (Runnable onChange)
 Called whenever notifications of a change go out: the state changed (the service persists it).
 
synchronized void start (int port) throws IOException
 
int port ()
 
ControlSession open (java.io.InputStream in, java.io.OutputStream out, java.io.Closeable closer)
 Adds a connection that is not a socket (in process): its streams and what closes it.
 
void broadcast (List< JSONObject > notifications, ControlSession origin)
 Sends the notifications to every control connection except origin (null: to all).
 
void ended (ControlSession session)
 
void close ()
 
- Public Member Functions inherited from de.yaacc.snapcast.server.ControlSession.Hub

Detailed Description

The control port of the built-in server (issue #330, task 3.2), by default 1705: the listener, the filter of addresses (rule S2, nothing is read before it passed), at most maxConnections at a time (S3), and the hub that sends notifications to the open connections.

Connections that do not come over a socket (the app's own, in process) join through open.

Constructor & Destructor Documentation

◆ ControlServer()

de.yaacc.snapcast.server.ControlServer.ControlServer ( SnapcastServer server,
Predicate< InetAddress > accept,
int maxConnections,
java.util.function.Supplier< String > defaultCodec )
Parameters
defaultCodecthe codec of a stream that is added without one
Here is the call graph for this function:

Member Function Documentation

◆ broadcast()

void de.yaacc.snapcast.server.ControlServer.broadcast ( List< JSONObject > notifications,
ControlSession origin )

Sends the notifications to every control connection except origin (null: to all).

Implements de.yaacc.snapcast.server.ControlSession.Hub.

Referenced by de.yaacc.snapcast.server.ControlServer.ControlServer().

Here is the caller graph for this function:

◆ ended()

void de.yaacc.snapcast.server.ControlServer.ended ( ControlSession session)

◆ open()

ControlSession de.yaacc.snapcast.server.ControlServer.open ( java.io.InputStream in,
java.io.OutputStream out,
java.io.Closeable closer )

Adds a connection that is not a socket (in process): its streams and what closes it.

Starts its thread.


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