Session class
- Available extensions
Constructors
- Session(String? realm, AbstractTransport _transport, {WampE2eeProvider? e2eeProvider, SessionE2eeProviderResolver? e2eeProviderResolver})
Properties
-
authExtra
↔ Map<
String, dynamic> ? -
the authExtra returned by the server
getter/setter pair
- authId ↔ String?
-
The authId that has been authenticated with
getter/setter pair
- authMethod ↔ String?
-
The authMethod used to authenticate the session
getter/setter pair
- authProvider ↔ String?
-
the authProvider used to authenticate the session
getter/setter pair
- authRole ↔ String?
-
The authRole given by the server
getter/setter pair
- e2eeProvider → WampE2eeProvider?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int?
-
The sessions id
getter/setter pair
- negotiatedE2ee → NegotiatedSessionE2ee?
-
no setter
- nextCallId ↔ int
-
the next id used to generate request id for a call
getter/setter pair
- nextPublishId ↔ int
-
the next id used to generate request id for a publish event
getter/setter pair
- nextRegisterId ↔ int
-
the next id used to generate request id for a registration
getter/setter pair
- nextSubscribeId ↔ int
-
the next id used to generate request id for a subscription
getter/setter pair
- nextUnregisterId ↔ int
-
the next id used to generate request id for an unregister even
getter/setter pair
- nextUnsubscribeId ↔ int
-
the next id used to generate request id for an unsubscribe event
getter/setter pair
- onConnectionLost → Future
-
no setter
- onDisconnect → Future
-
no setter
-
onGoodbye
→ Future<
Goodbye> -
Completes when the peer sends
GOODBYE, after the reply is queued.no setter - realm ↔ String?
-
The sessions realm
getter/setter pair
-
registrations
→ Map<
int, Registered> -
A map that stores all the active registrations
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
subscriptions
→ Map<
int, Subscribed> -
A map that stores all the active subscriptions
final
Methods
-
authenticate(
Authenticate authenticate) → void -
This sends the
authenticatemessage to the transport outgoing stream. -
call(
String procedure, {List? arguments, Map< String, dynamic> ? argumentsKeywords, CallOptions? options, Completer<String> ? cancelCompleter}) → Stream<Result> -
This calls a
procedurewith the givenargumentsand/orargumentsKeywordswith the givenoptions. The WAMP router will either respond with one or more results or the caller may cancel the call by callingcancelCompleter.complete(). -
callLazyPayload(
String procedure, {required LazyMessagePayload payload, CallOptions? options, Completer< String> ? cancelCompleter}) → Stream<Result> -
This calls a
procedurewith a LazyMessagePayload so encoded args / kwargs bytes can flow through the serializer without eager decode. -
callSingle(
String procedure, {List? arguments, Map< String, dynamic> ? argumentsKeywords, CallOptions? options, Completer<String> ? cancelCompleter}) → Future<Result> -
This calls a
procedureand waits for the final non-progressive Result. Progressive interim results are ignored; use call when the caller needs the stream. -
callSingleLazyPayload(
String procedure, {List? arguments, Map< String, dynamic> ? argumentsKeywords, CallOptions? options, Completer<String> ? cancelCompleter}) → Future<LazyResultPayload> -
This calls a
procedureand returns the final non-progressive payload as a lazy view over the transport payload when possible. -
callSingleLazyPayloadView(
String procedure, {required LazyMessagePayload payload, CallOptions? options, Completer< String> ? cancelCompleter}) → Future<LazyResultPayload> -
This calls a
procedurewith a LazyMessagePayload and returns the final non-progressive payload as a lazy view over the transport payload. -
callSinglePayload(
String procedure, {List? arguments, Map< String, dynamic> ? argumentsKeywords, CallOptions? options, Completer<String> ? cancelCompleter}) → Future<ResultPayload> -
This calls a
procedureand waits for the final non-progressive payload without materializing a Result object on the native fast path. -
callSinglePayloadWithLazyPayload(
String procedure, {required LazyMessagePayload payload, CallOptions? options, Completer< String> ? cancelCompleter}) → Future<ResultPayload> -
This calls a
procedurewith a LazyMessagePayload and waits for the final non-progressive payload without materializing a Result object. -
callSingleWithLazyPayload(
String procedure, {required LazyMessagePayload payload, CallOptions? options, Completer< String> ? cancelCompleter}) → Future<Result> -
This calls a
procedurewith a LazyMessagePayload and waits for the final non-progressive Result. -
close(
{String message = 'Regular closing', Duration? timeout}) → Future< void> -
Sends a goodbye message and closes the transport after a given
timeout. If no timeout is set, the client waits for the server to close the transport forever. -
isConnected(
) → bool - If there is a transport object that is opened and the incoming stream has not been closed, this will return true.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
publish(
String topic, {List? arguments, Map< String, dynamic> ? argumentsKeywords, PublishOptions? options}) → Future<Published?> -
This publishes an event to a
topicwith the givenargumentsandargumentsKeywords. -
publishLazyPayload(
String topic, {required LazyMessagePayload payload, PublishOptions? options}) → Future< Published?> - This publishes an event with a LazyMessagePayload so encoded args / kwargs bytes can pass through the serializer without eager decode.
-
register(
String procedure, {RegisterOptions? options}) → Future< Registered> -
This registers a
procedurewith the givenoptionsthat may be called by other sessions. -
registerHandler(
String procedure, FutureOr< void> onInvoke(Invocation invocation), {RegisterOptions? options}) → Future<Registered> -
This registers a
procedureand routes invocations directly toonInvokewithout requiring the caller to touch Registered.invocationStream. -
registerLazyPayloadHandler(
String procedure, FutureOr< void> onInvoke(LazyInvocationPayload invocation), {RegisterOptions? options}) → Future<Registered> -
This registers a
procedureand routes invocation payloads directly toonInvokeas lazy payload views. -
registerPayloadHandler(
String procedure, FutureOr< void> onInvoke(InvocationPayload invocation), {RegisterOptions? options}) → Future<Registered> -
This registers a
procedureand routes invocation payloads directly toonInvokewithout forcing Invocation allocation on the native fast path. -
releaseSubscription(
Subscribed subscribed) → Future< void> - Releases one local handler attached to a WAMP subscription.
-
setFile(
String procedure, WampFileSource source, {int chunkSize = defaultWampFileChunkSize, Duration timeout = const Duration(minutes: 5), CallOptions? options}) → Future< Result> -
Available on Session, provided by the WampFileSession extension
-
startProgressiveCall(
String procedure, {List? arguments, Map< String, dynamic> ? argumentsKeywords, CallOptions? options, Completer<String> ? cancelCompleter, bool enableFileSegments = false}) → ProgressiveCall -
subscribe(
String topic, {SubscribeOptions? options}) → Future< Subscribed> -
This subscribes the session to a
topic. The subscriber may passoptionswhile subscribing. The resulting events are passed to the Subscribed.eventStream. The subscriber should therefore subscribe to that stream to receive the events. -
subscribeHandler(
String topic, void onEvent(Event event), {SubscribeOptions? options}) → Future< Subscribed> -
This subscribes the session to a
topicand routes events directly toonEventwithout requiring the caller to touch Subscribed.eventStream. -
subscribeLazyPayloadHandler(
String topic, void onEvent(LazyEventPayload event), {SubscribeOptions? options}) → Future< Subscribed> -
This subscribes the session to a
topicand routes lazy payload views directly toonEventso encoded payload bytes can be forwarded without forcing immediate decode. -
subscribePayloadHandler(
String topic, void onEvent(EventPayload event), {SubscribeOptions? options}) → Future< Subscribed> -
This subscribes the session to a
topicand routes payloads directly toonEventwithout forcing Event allocation on the native fast path. -
toString(
) → String -
A string representation of this object.
inherited
-
unregister(
int registrationId) → Future< void> -
This unregisters a procedure by its
registrationId. Use the Registered.registrationId to unregister. -
unsubscribe(
int subscriptionId) → Future< void> - This unsubscribes the session from a subscription. Use the Subscribed.subscriptionId to unsubscribe.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
start(
String? realm, AbstractTransport transport, {String? authId, String? authRole, Map< String, dynamic> ? authExtra, List<AbstractAuthentication> ? authMethods, Duration? reconnect, WampE2eeProvider? e2eeProvider, SessionE2eeProviderResolver? e2eeProviderResolver}) → Future<Session> - Starting the session will also start the authentication process.