FakeWsSession class final

Server side of the freedome.v1 protocol (02e §8.1).

Inheritance

Constructors

FakeWsSession(FakeEventBus bus, MessageSocket socket, FakePrincipalLookup lookup, {required Map<String, Object?> welcomeServer(), required FakeCallHandler onCall, int heartbeatSec = 20, bool answerPings = true})
Starts serving socket.

Properties

answerPings ↔ bool
When false the session ignores pings (heartbeat-loss tests).
getter/setter pair
bus → FakeEventBus
Bus.
finalinherited
closed → bool
Whether the session is closed.
no setterinherited
filters → Set<String>
Subscribed filters.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
heartbeatSec → int
Announced heartbeat.
final
lookup → FakePrincipalLookup
Token → scopes.
finalinherited
onCall → FakeCallHandler
Executes call messages.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes ↔ Set<String>?
Scopes of the authenticated principal (null before hello / init).
getter/setter pairinherited
socket → MessageSocket
The server side socket.
finalinherited
token ↔ String?
Token presented.
getter/setter pairinherited
welcomeServer → Map<String, Object?> Function()
welcome.server (the info body).
final

Methods

allowed(String topic) → bool
Whether scopes may see topic.
inherited
bye(int code, String reason) → Future<void>
Sends bye and closes with code.
close([int code = 1000, String? reason]) → Future<void>
Closes the session.
override
deliver(FreedomeEvent e) → void
Sends an event if it matches a filter and the scope allows it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replay(Iterable<String> topics, int sinceSeq) → List<FreedomeEvent>?
Matching ring-buffer events after sinceSeq for topics, or null when the gap is too old.
inherited
sendResync(List<String> topics, String reason) → void
Sends resync for topics.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited