Add SignalR persistent connection at runtime (self host)

给你一囗甜甜゛ 提交于 2019-12-11 12:36:24

问题


I'm trying to add a path for a persistent connection at runtime. I found an example using SignalR.Hosting.Self, Version=0.5.1.10822, which has the Server class. Using that class, it is possible to do this:

        server.MapConnection<PathOneConnection>("/Path1/");
        server.Start();
        server.MapConnection<PathTwoConnection>("/Path2/");

Which worked, so I began hopefully creating my solution - starting out by getting the nuget packages....

However the newer version of SignalR uses an IAppBuilder

public void Configuration(IAppBuilder app)

to startup, which does not allow to add paths after

WebApp.Start<Startup>("http://*:8080/");

(or at least, it seems to be ineffective, as it won't add anything)

Is there any way to register a new server endpoint, while running?

EDIT, since this was tagged as duplicate:

  • It's running as a self-hosted enviroment
  • It's about persistent connection - not hubs - so IHubDescriptorProvider will not be helpfull i'm afraid

来源:https://stackoverflow.com/questions/37014777/add-signalr-persistent-connection-at-runtime-self-host

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!