connectanum 1.0.0-dev.5

  • Readme
  • Changelog
  • Installing
  • 65

connectanum-dart #

This is a WAMP client implementation for the dart language and flutter projects. The projects aims to provide a simple and extensible structure that is easy to use. With this project I want return something to the great WAMP-Protocol community.

WAMP is trademark of Technologies GmbH.


  • add code coverage report
  • add github runners to test code with multiple dart versions
  • Multithreading for callee invocations
    • callee interrupt thread on incoming cancellations
  • better docs
  • msgpack serializer
  • unit test websocket transport
    • currently fails in browser, works in VM
  • get the auth id that called a method
  • handle ping pong times
  • auto reconnect handling, but keep abstract socket interface
    • difference between intentionally and unintentionally disconnect
    • websocket has error and regular close event. use them if possible or use close with internal state from this package?

Supported WAMP features #

Authentication #

Advanced RPC features #

  • ☑ Progressive Call Results
  • ☑ Progressive Calls
  • ☐ Call Timeouts
  • ☑ Call Canceling
  • ☑ Caller Identification
  • ☐ Call Trust Levels
  • ☑ Shared Registration
  • ☐ Sharded Registration

Advanced PUB/SUB features #

  • ☑ Subscriber Black- and Whitelisting
  • ☑ Publisher Exclusion
  • ☑ Publisher Identification
  • ☐ Publication Trust Levels
  • ☑ Pattern-based Subscriptions
  • ☐ Sharded Subscriptions
  • ☐ Subscription Revocation

Stream model #

The transport contains an incoming stream that is usually a single subscribe stream. A session will internally open a new broadcast stream as soon as the authentication process is successful. The transport stream subscription passes all incoming messages to the broad cast stream. If the transport stream is done, the broadcast stream will close as well. The broad cast stream is used to handle all session methods. The user will never touch the transport stream directly.

Start the client #

To start a client you need to choose a transport module and connect it to the desired endpoint. When the connection has been established you can start to negotiate a client session by calling the client.connect() method from the client instance. On success the client will return a session object.

If your transport disconnects the session will invalidate. If a reconnect is configured, the session will try to authenticate an revalidate the session again. All subscriptions and registrations will be recovered if possible.

final client = Client(
  realm: "my.realm",transport: WebSocketTransport("wss://localhost:8443")
final session = await client.connect();


to work with RPCs you need to have an established session.

final client = Client(
  realm: "my.realm",new WebSocketTransport("wss://localhost:8443")
final session = await client.connect();

// Register a procedure
final registered = await session.register("my.procedure");
registered.onInvoke((invocation) {
  // to something with the invocation

// Call a procedure
await for (final result in"my.procedure")) {
  // do something with the result

1.0.0-dev.5 #

  • more cleanup code to meet pana analysis requirements

1.0.0-dev.4 #

  • more cleanup code to meet pana analysis requirements
  • added a working unit test for websocket transport in the vm

1.0.0-dev.3 #

  • more cleanup code to meet pana analysis requirements

1.0.0-dev.2 #

  • cleanup code to meet pana analysis requirements

1.0.0-dev.1 #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  connectanum: ^1.0.0-dev.5

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:connectanum/connectanum.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Health suggestions

Fix lib/src/serializer/json/serializer.dart. (-1.49 points)

Analysis of lib/src/serializer/json/serializer.dart reported 3 hints:

line 158 col 13: Unnecessary new keyword.

line 168 col 13: Unnecessary new keyword.

line 183 col 13: Unnecessary new keyword.

Fix lib/src/message/invocation.dart. (-1 points)

Analysis of lib/src/message/invocation.dart reported 2 hints:

line 19 col 19: Use = to separate a named parameter from its default value.

line 21 col 23: Use = to separate a named parameter from its default value.

Fix lib/src/message/uri_pattern.dart. (-1 points)

Analysis of lib/src/message/uri_pattern.dart reported 2 hints:

line 9 col 12: Use isNotEmpty instead of length

line 13 col 12: Use isNotEmpty instead of length

Fix additional 9 files with analysis or formatting issues. (-4.50 points)

Additional issues in the following files:

  • lib/src/protocol/session.dart (2 hints)
  • lib/src/authentication/ticket_authentication.dart (1 hint)
  • lib/src/client.dart (1 hint)
  • lib/src/transport/socket/socket_helper.dart (1 hint)
  • lib/src/transport/socket/socket_transport.dart (1 hint)
  • lib/src/transport/websocket/websocket_transport_html.dart (1 hint)
  • lib/src/transport/websocket/websocket_transport_io.dart (1 hint)
  • lib/src/transport/websocket/websocket_transport_none.dart (1 hint)
  • lib/src/authentication/scram/saslprep.dart (Run dartfmt to format lib/src/authentication/scram/saslprep.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and connectanum.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
logging ^0.11.4 0.11.4
pointycastle ^1.0.2 1.0.2
Dev dependencies
stream_channel 2.0.0
test ^1.12.0