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

One connection to the control port of the built-in server (issue #330, task 3.2): JSON-RPC, one request (or a batch) per line. More...

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

Classes

interface  Hub
 Where the notifications of a change go and what the session tells when it ends. More...
 

Public Member Functions

 ControlSession (InputStream in, OutputStream out, Closeable closer, RpcDispatcher dispatcher, Hub hub)
 
boolean isClosed ()
 
void send (JSONObject json)
 Queues one JSON line for this connection (any thread); a connection that is too far behind is dropped.
 
void run ()
 
void close ()
 

Static Public Attributes

static final int MAX_LINE_BYTES = 64 * 1024
 
static final int MAX_BATCH = 16
 
static final int MAX_NESTING = 32
 
static final int MAX_QUEUE_LINES = 256
 
static final long MAX_QUEUE_BYTES = 1024L * 1024L
 
static final long IDLE_LIMIT_MILLIS = 60L * 60L * 1000L
 A snapserver never closes a silent control connection; one that is abandoned (a half-open one) is let go after an hour.
 

Detailed Description

One connection to the control port of the built-in server (issue #330, task 3.2): JSON-RPC, one request (or a batch) per line.

One reader thread (this runnable, answers go to the queue) and one writer thread; the queue is capped, so a connection that does not read is dropped and holds nobody (rule S3). A line is at most 64 KiB and has to be finished in 10 seconds.

Member Data Documentation

◆ IDLE_LIMIT_MILLIS

final long de.yaacc.snapcast.server.ControlSession.IDLE_LIMIT_MILLIS = 60L * 60L * 1000L
static

A snapserver never closes a silent control connection; one that is abandoned (a half-open one) is let go after an hour.

The app says something every minute.


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