Client constructor

Client({
  1. required AbstractTransport transport,
  2. String? authId,
  3. String? authRole,
  4. String? realm,
  5. List<AbstractAuthentication>? authenticationMethods,
  6. Map<String, dynamic>? authExtra,
  7. int isolateCount = 1,
})

The client connects to the wamp server by using the given transport and the given authenticationMethods. Passing more then one AbstractAuthentication to the client will make the router choose which method to choose. The authId and the realm will be used for all given authenticationMethods

Example:

import 'package:connectanum/connectanum.dart';
import 'package:connectanum/socket.dart';

final client = Client(
  realm: "test.realm",
  transport: SocketTransport(
    'localhost',
    8080,
    Serializer(),
    SocketHelper.SERIALIZATION_JSON
  )
);

final Session session = await client.connect();

Implementation

Client(
    {required this.transport,
    this.authId,
    this.authRole,
    this.realm,
    this.authenticationMethods,
    this.authExtra,
    this.isolateCount = 1})
    : assert(realm == null || UriPattern.match(realm)) {
  _connectStreamSubscription =
      _connectStreamController.stream.listen(_connect);
}