本文整理汇总了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");
}
示例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 } );
}
示例3: Configuration
public void Configuration(IAppBuilder app)
{
var config = new HubConfiguration()
{
EnableCrossDomain = true,
EnableDetailedErrors = true
};
app.MapHubs(config);
app.MapConnection<EventIncrementPersistantConnection>("/events/increment");
}
示例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);
}
示例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());
}
示例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);
}
示例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() });
}
示例8: Configuration
public void Configuration(IAppBuilder app)
{
app.MapConnection<QueryablePushService<MyPushContext>>("/events", new ConnectionConfiguration { EnableCrossDomain = true });
}
示例9: ConfigureSignalR
public void ConfigureSignalR(IAppBuilder app)
{
app.MapConnection<AuthorizeEchoConnection>("/echo");
app.MapSignalR();
}
示例10: Attach
public void Attach(IAppBuilder appBuilder)
{
appBuilder.MapConnection("signalr", typeof(NzbDronePersistentConnection), new ConnectionConfiguration { EnableCrossDomain = true });
}
示例11: Configuration
public void Configuration(IAppBuilder app)
{
app.MapConnection<MyConnection>("/echo");
app.MapConnection<GroupConnection>("/group");
}
示例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 { });
}