-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Description
Hi again Elad,
I have another issue - when registering InMemoryBinding with WampAuthenticationHost, the call to RegisterTransport fails with:
System.ArgumentException: 'Got no binding. Expected at least one binding. Parameter name: bindings'
Apparently the problem is in WampAuthenticationHost.RegisterTransport:
IEnumerable<IWampBinding> authenticationBindings =
bindings.Select(binding => CreateAuthenticationBinding((dynamic) binding))
.Cast<IWampBinding>()
.Where(x => x != null);as authenticationBindings is empty after the call.
Repro:
using System;
using System.Reactive.Concurrency;
using WampSharp.Binding;
using WampSharp.Fleck;
using WampSharp.V2;
using WampSharp.V2.Authentication;
using WampSharp.V2.Binding;
using WampSharp.V2.Client;
using WampSharp.V2.MetaApi;
using WampSharp.V2.Transports;
namespace WampRouter
{
class Program
{
private static WampChannelFactory mChannelFactory;
private static InMemoryTransport mInMemoryTransport;
private static InMemoryBinding mInMemoryBinding;
class AuthFactory : IWampSessionAuthenticatorFactory
{
public IWampSessionAuthenticator GetSessionAuthenticator(WampPendingClientDetails details,
IWampSessionAuthenticator transportAuthenticator)
{
throw new NotImplementedException();
}
}
static void Main()
{
JTokenJsonBinding jsonBinding = new JTokenJsonBinding();
JTokenMsgpackBinding msgPackBinding = new JTokenMsgpackBinding();
var host = new WampAuthenticationHost(new AuthFactory());
FleckWebSocketTransport websocketTransport = new FleckWebSocketTransport("ws://0.0.0.0:50002/");
host.RegisterTransport(websocketTransport, jsonBinding, msgPackBinding);
mInMemoryBinding = new InMemoryBinding();
mInMemoryBinding.AddFormatter(jsonBinding.Formatter);
mInMemoryBinding.AddFormatter(msgPackBinding.Formatter);
mChannelFactory = new WampChannelFactory();
mInMemoryTransport = new InMemoryTransport(DefaultScheduler.Instance);
host.RegisterTransport(mInMemoryTransport,
new IWampBinding[] { mInMemoryBinding });
host.Open();
Console.WriteLine("Host running.");
Console.ReadLine();
}
}
}Thanks
Esso