private void OpenTransports() { foreach (WampTransportDefinition transportDefinition in mTransportDefinitions) { IWampTransport transport = transportDefinition.Transport; transport.Open(); } }
public override void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings) { IEnumerable <IWampBinding> authenticationBindings = bindings.Select(binding => CreateAuthenticationBinding((dynamic)binding)) .Cast <IWampBinding>() .Where(x => x != null); base.RegisterTransport(transport, authenticationBindings); }
public virtual void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings) { IEnumerable <IWampBinding> bindingArray = bindings.ToArray(); mExternalHost.RegisterTransport(transport, bindingArray); foreach (IWampBinding currentBinding in bindingArray) { AddFormatter((dynamic)currentBinding); } }
public override void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings) { if (mDefaultAuthenticatorFactory == null) { ThrowHelper.NoDefaultSessionAuthenticatorWasProvided(); } IDictionary <IWampBinding, IWampSessionAuthenticatorFactory> bindingToDefaultAuthenticator = bindings.ToDictionary(x => x, x => mDefaultAuthenticatorFactory); RegisterTransport(transport, bindingToDefaultAuthenticator); }
public void RegisterTransport(IWampTransport transport, IDictionary <IWampBinding, IWampSessionAuthenticatorFactory> bindingToAuthenticatorFactory) { IEnumerable <IWampBinding> authenticationBindings = bindingToAuthenticatorFactory .Select(binding => CreateAuthenticationBinding((dynamic)binding.Key, binding.Value)) .Cast <IWampBinding>() .Where(x => x != null); base.RegisterTransport(transport, authenticationBindings); }
public void Dispose() { foreach (WampTransportDefinition transportDefinition in mTransportDefinitions) { IWampTransport transport = transportDefinition.Transport; transport.Dispose(); } foreach (IWampBindingHost bindingHost in mBindingToHost.Values) { bindingHost.Dispose(); } }
public void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings) { bindings = bindings ?? new IWampBinding[] {}; IWampBinding[] bindingArray = bindings.ToArray(); if (bindingArray.Any()) { mTransportDefinitions.Add(new WampTransportDefinition() { Transport = transport, Bindings = bindingArray }); } else { throw new ArgumentException("Got no binding. Expected at least one binding.", nameof(bindings)); } }
/// <summary> /// Registers a given transport for a given host. /// </summary> /// <param name="host">The given host.</param> /// <param name="transport">The given transport to register.</param> /// <param name="binding">The given bindings to activate support with the given transport.</param> public static void RegisterTransport(this IWampHost host, IWampTransport transport, params IWampBinding[] binding) { host.RegisterTransport(transport, binding); }
public MockTransportFactory(IWampTransport instance) { this.instance = instance; }
public sealed override void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings) { base.RegisterTransport(transport, bindings); }