YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.share.ShareLimits Class Reference

The numbers that bound a share, in one place: how long it lives, how often the registry is swept, how much is sent per read and how many responses one share serves at the same time. More...

Collaboration diagram for de.yaacc.share.ShareLimits:
Collaboration graph

Static Public Attributes

static final long IDLE_GRACE_MILLIS = 10L * 60L * 1000L
 How long a share stays available after its player ended (a renderer may still buffer or seek).
 
static final long ABSOLUTE_MAX_MILLIS = 6L * 60L * 60L * 1000L
 How long a share lives at most, whatever happens.
 
static final long SWEEP_INTERVAL_MILLIS = 60L * 1000L
 How often the registry drops expired entries without any request.
 
static final int CHUNK_BYTES = 64 * 1024
 Bytes per read when streaming a file (the response buffer is this big).
 
static final int MAX_CONCURRENT_RESPONSES_PER_SHARE = 4
 Concurrent responses per share.
 
static final long WRITE_IDLE_MILLIS = 60L * 1000L
 How long a response may make no progress before the watchdog takes its slot away: a reader that stalls or trickles must not hold one of the few slots of a share.
 
static final int MIN_PROGRESS_BYTES = 16 * 1024
 Progress is counted in steps of this many bytes within WRITE_IDLE_MILLIS; less is a trickle (about 270 bytes per second), not playback.
 
static final long CLAIM_WINDOW_MILLIS = 2L * 60L * 1000L
 How long a share that no player claimed may stay in the registry (and, for a file, hold its descriptor): the player is created right after the registration, so two minutes is generous.
 
static final long PENDING_SHARE_TIMEOUT_MILLIS = 2L * 60L * 1000L
 How long a pending (unconfirmed) share waits for the user's receiver pick.
 
static final long COPY_FREE_SPACE_RESERVE_BYTES = 64L * 1024L * 1024L
 Free space that must stay on the volume while a provider file is copied: 64 MiB.
 
static final long INCOMING_DIR_MAX_BYTES = 1024L * 1024L * 1024L
 All copies together in cache/incoming/: 1 GiB.
 
static final long PROVIDER_CALL_TIMEOUT_MILLIS = 3_000L
 The longest a provider call (type, name, opening the descriptor) may take before the share is dropped.
 
static final long PROVIDER_OPEN_TIMEOUT_MILLIS = 20_000L
 The longest opening a provider descriptor may take after the user confirmed (some providers fetch the file first); longer than the type and name queries.
 
static final long COPY_MAX_MILLIS = 5L * 60L * 1000L
 The longest the copy fallback may run: a provider that trickles must not hold the copy slot forever.
 
static final long ACTION_FLIGHT_MAX_MILLIS = COPY_MAX_MILLIS + 60_000L
 The longest one picked action may hold the single flight (ActionFlight) before it counts as lost: longer than the copy fallback (COPY_MAX_MILLIS), the slowest start.
 
static final long LAUNCH_NONCE_TTL_MILLIS = 30_000L
 How long the token that the launcher puts into the intent it forwards stays valid: the browser reads it in onCreate/onNewIntent, which follows the forward at once.
 
static final int LAUNCH_NONCE_MAX_OUTSTANDING = 8
 Tokens minted but not yet used; the oldest is dropped beyond this (one forward is one token).
 
static final int PROVIDER_POOL_THREADS = 4
 Threads of each provider pool (intake probe, confirmed open).
 
static final int PROVIDER_MAX_TRACKED = 3
 Providers that may have a call outstanding at the same time, hung ones included.
 
static final int COPY_MAX_STUCK_WORKERS = 3
 Copy workers that may stay stuck (abandoned after the deadline) at the same time; beyond this a new copy is turned away as busy instead of starting one more thread.
 

Detailed Description

The numbers that bound a share, in one place: how long it lives, how often the registry is swept, how much is sent per read and how many responses one share serves at the same time.

Member Data Documentation

◆ MAX_CONCURRENT_RESPONSES_PER_SHARE

final int de.yaacc.share.ShareLimits.MAX_CONCURRENT_RESPONSES_PER_SHARE = 4
static

Concurrent responses per share.

A renderer opens a few connections (probe, seek, buffer); more than this is not playback.

◆ PROVIDER_MAX_TRACKED

final int de.yaacc.share.ShareLimits.PROVIDER_MAX_TRACKED = 3
static

Providers that may have a call outstanding at the same time, hung ones included.

Below PROVIDER_POOL_THREADS: at most 3 of the 4 threads are ever inside provider calls. One hung provider holds one place; three distinct hung providers use up all places until a call returns.

Referenced by de.yaacc.share.ProviderCallGate.createDefault().

◆ PROVIDER_POOL_THREADS

final int de.yaacc.share.ShareLimits.PROVIDER_POOL_THREADS = 4
static

Threads of each provider pool (intake probe, confirmed open).

A Binder call into another process cannot be interrupted, so a hung provider pins its thread. The per-provider gate (PROVIDER_MAX_TRACKED) keeps one provider to one thread, for as long as its call is outstanding, and lets at most that many threads into provider calls at once; the pool is larger, so a thread is left for everything else (a call that has just returned and is still finishing, a new provider).

◆ WRITE_IDLE_MILLIS

final long de.yaacc.share.ShareLimits.WRITE_IDLE_MILLIS = 60L * 1000L
static

How long a response may make no progress before the watchdog takes its slot away: a reader that stalls or trickles must not hold one of the few slots of a share.

(The server-wide socket timeout is 5 minutes and does not fire while a peer trickles.) The response itself survives a pause: when it is called again it asks for a slot again and aborts only if the share is full.


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