Session class

Constructors

Session(String? realm, AbstractTransport _transport)

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
hashCode int
The hash code for this object.
no setterinherited
id int?
The sessions id
getter/setter pair
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
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().
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.
register(String procedure, {RegisterOptions? options}) Future<Registered>
This registers a procedure with the given options that may be called by other sessions.
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.
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}) Future<Session>
Starting the session will also start the authentication process.