Inheritance: IDependencyResolver
        public static IDependencyResolver BuildCompressionDependencyResolver()
        {
            var resolver = new DefaultDependencyResolver();
            resolver.Compression().CompressPayloads(resolver);

            return resolver;
        }
Ejemplo n.º 2
0
        public TestableLoadHub()
        {
            const string connectionId = "1234";
            const string hubName = "LoadHub";
            var resolver = new DefaultDependencyResolver();
            Config = resolver.Resolve<IConfigurationManager>();

            var mockConnection = new Mock<IConnection>();
            var mockUser = new Mock<IPrincipal>();
            var mockHubPipelineInvoker = new Mock<IHubPipelineInvoker>();

            var mockRequest = new Mock<IRequest>();
            mockRequest.Setup(r => r.User).Returns(mockUser.Object);

            var tracker = new StateChangeTracker();

            Clients = new HubConnectionContext(mockHubPipelineInvoker.Object, mockConnection.Object, hubName, connectionId, tracker);
            Context = new HubCallerContext(mockRequest.Object, connectionId);
        }
        public SampleSignalRServer(int httpPort, int netMQPort, IEnumerable<int> subscriberPorts)
        {
            string serverUrl = string.Format("http://localhost:{0}", httpPort);
            string netMQAddress = string.Format("tcp://127.0.0.1:{0}", netMQPort);
            var subscriberAddresses = subscriberPorts
                .Select(p => string.Format("tcp://127.0.0.1:{0}", p))
                .ToArray();
            var config = new NetMQScaleoutConfiguration(netMQAddress, subscriberAddresses);

            _httpServer = WebApp.Start(serverUrl, app =>
            {
                var resolver = new DefaultDependencyResolver();
                resolver.UseNetMQServiceBus(config);
                var assemblyLocator = new AssemblyLocator();
                resolver.Register(typeof(IAssemblyLocator), () => assemblyLocator);
                var hubConfiguration = new HubConfiguration
                {
                    Resolver = resolver,
                };
                app.MapSignalR(hubConfiguration);
            });
        }
Ejemplo n.º 4
0
 public SimpleInjectorSignalR(Container container)
 {
     _container = container;
     _defaultResolver = new DefaultDependencyResolver();
 }