HubConnection class abstract

Represents a connection to a Signalr Hub.

Constructors

HubConnection.create(Connection connection, Logger logger, HubProtocol protocol, [RetryPolicy? reconnectPolicy])
factory

Properties

baseURL String
Indicates the url of the HubConnection to the server.
getter/setter pair
connectionId String?
Represents the connection id of the HubConnection on the server. The connection id will be null when the connection is either in the disconnected state or if the negotiation step was skipped.
no setter
hashCode int
The hash code for this object.
no setterinherited
keepAliveIntervalInMilliseconds int
Default interval at which to ping the server.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverTimeoutInMilliseconds int
The server timeout in milliseconds.
getter/setter pair
state HubConnectionState
Indicates the state of the HubConnection to the server.
no setter

Methods

invokeAsync(String methodName, [List? args]) Future
Invokes a hub method on the server using the specified name and arguments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String methodName, [void method(List args)?]) → void
Removes the specified handler for the specified hub method.
on(String methodName, void newMethod(List args)) → void
Registers a handler that will be invoked when the hub method with the specified method name is invoked.
onclose(void callback(Object? error)) → void
Registers a handler that will be invoked when the connection is closed.
onreconnected(void callback(String? connectionId)) → void
Registers a handler that will be invoked when the connection successfully reconnects.
onreconnecting(void callback(Object? error)) → void
Registers a handler that will be invoked when the connection starts reconnecting.
sendAsync(String methodName, [List? args]) Future<void>
Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.
startAsync() Future<void>
Starts the connection.
stopAsync() Future<void>
Stops the connection.
stream(String methodName, [List? args]) Stream
Invokes a streaming hub method on the server using the specified name and arguments.
toString() String
A string representation of this object.
inherited

Operators

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