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 authenticate message to the transport outgoing stream.
call(String procedure, {List? arguments, Map<String, dynamic>? argumentsKeywords, CallOptions? options, Completer<String>? cancelCompleter}) Stream<Result>
This calls a procedure with the given arguments and/or argumentsKeywords with the given options. The WAMP router will either respond with one or more results or the caller may cancel the call by calling cancelCompleter.complete().
callLazyPayload(String procedure, {required LazyMessagePayload payload, CallOptions? options, Completer<String>? cancelCompleter}) Stream<Result>
This calls a procedure with 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 procedure and 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 procedure and 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 procedure with 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 procedure and 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 procedure with 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 procedure with 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 topic with the given arguments and argumentsKeywords.
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 procedure with the given options that may be called by other sessions.
registerHandler(String procedure, FutureOr<void> onInvoke(Invocation invocation), {RegisterOptions? options}) Future<Registered>
This registers a procedure and routes invocations directly to onInvoke without requiring the caller to touch Registered.invocationStream.
registerLazyPayloadHandler(String procedure, FutureOr<void> onInvoke(LazyInvocationPayload invocation), {RegisterOptions? options}) Future<Registered>
This registers a procedure and routes invocation payloads directly to onInvoke as lazy payload views.
registerPayloadHandler(String procedure, FutureOr<void> onInvoke(InvocationPayload invocation), {RegisterOptions? options}) Future<Registered>
This registers a procedure and routes invocation payloads directly to onInvoke without 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 pass options while 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 topic and routes events directly to onEvent without requiring the caller to touch Subscribed.eventStream.
subscribeLazyPayloadHandler(String topic, void onEvent(LazyEventPayload event), {SubscribeOptions? options}) Future<Subscribed>
This subscribes the session to a topic and routes lazy payload views directly to onEvent so 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 topic and routes payloads directly to onEvent without 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.