当前位置: 首页>>代码示例>>C#>>正文


C# IAppBuilder.MapConnection方法代码示例

本文整理汇总了C#中IAppBuilder.MapConnection方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.MapConnection方法的具体用法?C# IAppBuilder.MapConnection怎么用?C# IAppBuilder.MapConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAppBuilder的用法示例。


在下文中一共展示了IAppBuilder.MapConnection方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configuration

        public void Configuration(IAppBuilder app)
        {
            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();

            app.MapConnection<TestEndpoint>("/testendpoint");
        }
开发者ID:henllyee,项目名称:java-client,代码行数:7,代码来源:Startup.cs

示例2: Configuration

        public void Configuration(IAppBuilder app)
        {
            // web host uses BuildManagerAssemblyLocator, we need a manual way, somehow
            var a = Assembly.LoadFrom("ConvRse.Services.dll");

            app.MapConnection<ChatConnection>("/rawchat", new ConnectionConfiguration { EnableCrossDomain = true });
            app.MapHubs(new HubConfiguration { EnableCrossDomain = true } );
        }
开发者ID:ChristianWeyer,项目名称:SignalR_convRse,代码行数:8,代码来源:Startup.cs

示例3: Configuration

 public void Configuration(IAppBuilder app)
 {
     var config = new HubConfiguration()
     {
         EnableCrossDomain = true,
         EnableDetailedErrors = true
     };
     app.MapHubs(config);
     app.MapConnection<EventIncrementPersistantConnection>("/events/increment");
 }
开发者ID:ryantomlinson,项目名称:EventStreamR,代码行数:10,代码来源:Program.cs

示例4: Configuration

        public static void Configuration(IAppBuilder app)
        {
            var staticFileBasePath = Path.Combine(
                Directory.GetCurrentDirectory(),
                @"..\..\..\SignalR.Hosting.AspNet.Samples");

            Directory.SetCurrentDirectory(staticFileBasePath);

            ThreadPool.QueueUserWorkItem(_ =>
            {
                var context = GlobalHost.ConnectionManager.GetConnectionContext<Streaming>();
                var hubContext = GlobalHost.ConnectionManager.GetHubContext<DemoHub>();

                while (true)
                {
                    try
                    {
                        context.Connection.Broadcast(DateTime.Now.ToString());
                        hubContext.Clients.fromArbitraryCode(DateTime.Now.ToString());
                    }
                    catch (Exception ex)
                    {
                        Trace.TraceError("SignalR error thrown in Streaming broadcast: {0}", ex);
                    }
                    Thread.Sleep(2000);
                }
            });

            app.MapHubs("/signalr");

            app.MapConnection<SendingConnection>("/sending-connection");
            app.MapConnection<TestConnection>("/test-connection");
            app.MapConnection<Raw>("/raw/raw");
            app.MapConnection<Streaming>("/streaming/streaming");

            app.UseType<RedirectFoldersWithoutSlashes>();
            app.UseType<DefaultStaticFileName>("index.htm");
            app.UseType<DefaultStaticFileName>("index.html");
            app.UseType<ExtensionContentType>(".htm", "text/plain");
            app.UseType<ExtensionContentType>(".html", "text/plain");
            app.UseStatic(staticFileBasePath);
        }
开发者ID:neiz,项目名称:SignalR,代码行数:42,代码来源:Startup.cs

示例5: ConfigureApp

        protected virtual void ConfigureApp(IAppBuilder app)
        {
            var config = new ConnectionConfiguration
            {
                Resolver = Resolver
            };

            app.MapConnection<StressConnection>(Endpoint, config);

            config.Resolver.Register(typeof(IProtectedData), () => new EmptyProtectedData());
        }
开发者ID:hallco978,项目名称:SignalR,代码行数:11,代码来源:MemoryHostRun.cs

示例6: Configuration

        public void Configuration(IAppBuilder app)
        {
            var config = new HttpConfiguration { DependencyResolver = new ControllerResolver() };
            config.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
            config.Formatters.JsonFormatter.SerializerSettings.TypeNameHandling = TypeNameHandling.All;
            config.Routes.MapHttpRoute("Default", "{controller}/{id}", new { id = RouteParameter.Optional });
            app.UseWebApi(config);
            app.MapConnection<EventDispatcher>("", new ConnectionConfiguration { EnableCrossDomain = true });

            GlobalHost.DependencyResolver.Register(typeof(JsonSerializer), () => JsonSerializer.Create(new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.All
            }));

            var hubConfig = new HubConfiguration() { EnableCrossDomain = true };
            app.MapHubs(hubConfig);
        }
开发者ID:narzul,项目名称:SmartWard,代码行数:17,代码来源:WebApiServer.cs

示例7: Configuration

        public void Configuration(IAppBuilder app)
        {
            app.UseErrorPage();

            app.Use((context, func) =>
            {
                if (!context.Request.PathBase.HasValue)
                {
                    context.Request.Path = new PathString("/");
                    context.Request.PathBase = new PathString("/api");
                }

                return func();
            });
            
            app.MapConnection<MessageStreamerConnection>("/messagestream",
                new ConnectionConfiguration
                {
                    EnableCrossDomain = true,
                });

            app.UseNancy(new NancyOptions { Bootstrapper = new NServiceBusContainerBootstrapper() });
        }
开发者ID:dmitriylyner,项目名称:ServiceControl,代码行数:23,代码来源:Startup.cs

示例8: Configuration

 public void Configuration(IAppBuilder app)
 {
     app.MapConnection<QueryablePushService<MyPushContext>>("/events", new ConnectionConfiguration { EnableCrossDomain = true });
 }
开发者ID:PeteGoo,项目名称:Pushqa,代码行数:4,代码来源:Startup.cs

示例9: ConfigureSignalR

		public void ConfigureSignalR(IAppBuilder app)
        {
            app.MapConnection<AuthorizeEchoConnection>("/echo");
            app.MapSignalR();
        }
开发者ID:modulexcite,项目名称:BearerTokenAuthenticationSample,代码行数:5,代码来源:Startup.SignalR.cs

示例10: Attach

 public void Attach(IAppBuilder appBuilder)
 {
     appBuilder.MapConnection("signalr", typeof(NzbDronePersistentConnection), new ConnectionConfiguration { EnableCrossDomain = true });
 }
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:4,代码来源:SignalRMiddleWare.cs

示例11: Configuration

 public void Configuration(IAppBuilder app)
 {
     app.MapConnection<MyConnection>("/echo");
     app.MapConnection<GroupConnection>("/group");
 }
开发者ID:erizet,项目名称:SignalRtest,代码行数:5,代码来源:Program.cs

示例12: ConfigureSignalR

 public static void ConfigureSignalR(IAppBuilder app)
 {
     // For more information on how to configure your application using OWIN startup, visit http://go.microsoft.com/fwlink/?LinkID=316888
      app.MapSignalR();
      app.MapConnection<ChatConnection>("/chatapp", new ConnectionConfiguration { });
 }
开发者ID:kapil-sharma,项目名称:SignalRLearning,代码行数:6,代码来源:Startup.cs


注:本文中的IAppBuilder.MapConnection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。