WampSharp v1.2.3.12-beta release notes

New features

Router side authentication

Currently authentication details (authid, authmethod and authrole) are forwarded to callees if the caller is disclosed. These are accessible via WampInvocationContext. This might change according to the WAMP spec decision.

WampChannelFactory fluent syntax

This version introduces new api to obtain a IWampChannel. The api is fluent and allows customization.

In order to use it, you need to add an using directive. Note that the available api depends on which WampSharp packages you installed. (For instance, if you haven’t installed WampSharp.NewtonsoftMsgpack, then msgpack extension methods won’t be present)

Note: currently crossbar and Autobahn variants don’t implement RawSocket’s ping/pongs. Therefore, auto-ping is disabled by default. You can enable it manually, both for router-side transport (by passing to the RawSocketTransport constructor an non-null auto-ping interval) and for client-side transport (as in the sample).

Exposing meta-api

In order to expose meta-api, you can call an extension method of IWampHostedRealm, named “HostMetaApiService”. This method returns an IDisposable which you can dispose in order to unregister the meta-api service.

Note: it is important to call HostMetaApiService before hosting any other components (callees/subscribers), since otherwise the meta-api service isn’t be able to track components registered before it.

Consuming meta-api

In order to consume meta-api, you can use declare the WAMP meta-api contracts yourself and consume it with plain WampSharp client-side code. In order to save that amount of work, a client-side api is provided which allows you to consume the meta-api without having to write any contracts yourself. This is api is available via an extension method of IWampRealmProxy which is named “GetMetaApiServiceProxy”.

Bug fixes

This is related to the corresponding part of the spec which discusses valid uris. From this version, WampSharp router verifies that uris are valid as in the spec. The default behavior is loose/relaxed uri verification. You can change that behavior by passing a IWampUriValidator to the WampHost constructor. For example:

It turns out that using the WampSharp router resulted sometimes in a StackOverflowException. The reason for this is related to Reactive Extensions implementation of the Merge operator which uses recursion.. WampSharp used the Merge operator as a queue mechanism for sending messages serially per client. When a large number of messages was gathered for a client and then a client suddenly disconnected, this resulted in a large recursion stack which resulted in a StackOverflowException. It turns out that this is a known rx issue.