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

One client on the stream port of the built-in server (issue #330): the Hello, then settings, the codec header and chunks out, Time and ClientInfo in. More...

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

Classes

interface  Host
 What the server does for a session. More...
 
class  Join
 What a client gets at the start.
 
class  Refused
 The server refuses the client.
 

Public Member Functions

 StreamClientSession (InputStream in, OutputStream out, Closeable socket, String ip, Host host, MicroClock clock, FrameReader.ReadTimeout readTimeout)
 
String clientId ()
 The id the server gives this client, after its Hello; null before.
 
boolean isClosed ()
 
void sendSettings (ServerSettingsMessage settings)
 Sends the settings of the client (volume, mute, latency, buffer).
 
void setStream (String newStreamId, CodecHeaderMessage header)
 The client now plays this stream: its codec header goes first and chunks of that stream follow (none while header is null, a client in a group with no stream).
 
String streamId ()
 
void offerChunk (String forStream, long timestampMicros, byte[] payload)
 A chunk of a stream: queued if the client plays that stream; a client that falls too far behind is dropped.
 
void run ()
 
void close ()
 

Static Public Attributes

static final int MAX_QUEUE_MESSAGES = 1024
 
static final long MAX_QUEUE_BYTES = 4L * 1024 * 1024
 
static final int HELLO_TIMEOUT_MILLIS = 5_000
 
static final int IDLE_LIMIT_MILLIS = 30_000
 

Detailed Description

One client on the stream port of the built-in server (issue #330): the Hello, then settings, the codec header and chunks out, Time and ClientInfo in.

One reader thread (this runnable) and one writer thread; every other thread only queues messages, so a client that stops reading holds nobody: its queue has a size cap, and a client that reaches it is dropped (rule S3). Frames above 64 KiB, a Hello that does not come in time, too many frames per second or too many strange frames end the session.

Constructor & Destructor Documentation

◆ StreamClientSession()

de.yaacc.snapcast.server.StreamClientSession.StreamClientSession ( InputStream in,
OutputStream out,
Closeable socket,
String ip,
Host host,
MicroClock clock,
FrameReader.ReadTimeout readTimeout )
Parameters
readTimeoutsets the receive timeout of the socket (a test without a socket passes a no-op)

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