Пример #1
0
 private void OpenTransports()
 {
     foreach (WampTransportDefinition transportDefinition in mTransportDefinitions)
     {
         IWampTransport transport = transportDefinition.Transport;
         transport.Open();
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #6
0
        public void Dispose()
        {
            foreach (WampTransportDefinition transportDefinition in mTransportDefinitions)
            {
                IWampTransport transport = transportDefinition.Transport;
                transport.Dispose();
            }

            foreach (IWampBindingHost bindingHost in mBindingToHost.Values)
            {
                bindingHost.Dispose();
            }
        }
Пример #7
0
        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));
            }
        }
Пример #8
0
 /// <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);
 }
Пример #9
0
 public MockTransportFactory(IWampTransport instance)
 {
     this.instance = instance;
 }
Пример #10
0
 public sealed override void RegisterTransport(IWampTransport transport, IEnumerable <IWampBinding> bindings)
 {
     base.RegisterTransport(transport, bindings);
 }