Package-level declarations

Types

Link copied to clipboard
class EchoExtension(clock: () -> Long = System::currentTimeMillis) : TetherExtension

x.tether.echo (protocol §7.9): link diagnostics on every side. A request {ts, data?} with an id is answered with {ts, data?, at, via}: the request's own timestamp and data back, the responder's clock and its transport. The asker gets the round trip and an estimate of the clock offset. Touches nothing but the link, so it is safe on a test transport and harmless to leave on.

Link copied to clipboard
interface ExtensionHost

What an extension may ask of the app that hosts it.

Link copied to clipboard
interface ExtensionLink

One peer as the extensions see it: a connected client on the Android phone, the Android phone on a client. The host app implements it over its own connection; the registry decides what may be sent.

Link copied to clipboard
class ExtensionRegistry(log: (String) -> Unit = {}, clock: () -> Long = { System.nanoTime() / 1_000_000 }, dispatch: (Runnable) -> Unit = { it.run() }, onStatusChanged: () -> Unit = {})

Routes extension messages (protocol §7) between the links and the registered extensions, and keeps them from touching anything else: core types are never routed here or sent from here, sizes and rates are capped, an exception is logged and answered, an extension failing Ext.MAX_FAILURES times in a row is switched off.

Link copied to clipboard

An extension's handle on one link: everything it sends goes through the registry's checks.

Link copied to clipboard
interface TetherExtension

A feature added on top of the link without changing the core apps (protocol §7, docs/EXTENDING.md).