SocketIoConfig class
Socket.IO on the Dox HTTP port, at /socket.io/. Off by default.
SocketIoConfig(
enabled: true,
namespaces: [ChatNamespace()],
adapter: RedisSocketAdapterFactory(), // needed with many isolates
);
Many isolates: each isolate has its own Socket.IO server. Use the Redis
adapter so a broadcast reaches clients on every isolate. Clients must use
transports: ['websocket']. HTTP long-polling sends many requests,
and they can reach different isolates, so it needs totalIsolate: 1
(or sticky sessions in front of many servers).
Constructors
-
SocketIoConfig({bool enabled = false, ServerOptions options = const ServerOptions(), List<
NamespaceHandler> namespaces = const <NamespaceHandler>[], SocketAdapterFactory? adapter}) -
const
Properties
- adapter → SocketAdapterFactory?
-
Makes the adapter in each isolate. Null means in memory (one isolate).
final
- enabled → bool
-
Mount Socket.IO on the HTTP port.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
namespaces
→ List<
NamespaceHandler> -
Namespaces to register, like
ChatNamespace().final - options → ServerOptions
-
Engine options (path, ping, cors, transports).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited