I have a persistent connection which I would like to start with some seed info using query params. Here is the override in the connection.
protected override Task OnConnected(IRequest request, string connectionId)
{
//GET QUERY PARAMS HERE
return base.OnConnected(request, connectionId);
}
Now I have my route setup in global.asax file which looks like this.
RouteTable.Routes.MapConnection("myconnection", "/myconnection");
And the client code looks like this
var connection = $.connection('/myconnection');
connection.start()
.done(() =>
{
});
Can someone tell me how I can pass query string params to this connecton so I can read them in the override as I seem to be hitting a brick wall on this.
Cheers hope someone can help,
Dave
HUBS
and to get it on the server
To access your query string in javascript you could use something like
Call it:
PERSISTENT CONNECTION
Here is the source code where you can find out more: https://github.com/SignalR/SignalR/blob/master/src/Microsoft.AspNet.SignalR.Client.JS/jquery.signalR.core.js#L106