问题
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