Dmitry Kazakov
Dmitry Kazakov

Reputation: 1669

How to pass a QueryString value to SignalR server using Windows Form application

I am developing real-time network application using SignalR. I have Web and Windows Form clients. I am using QueryString to pass the parameter "param" from Web App client to server using this javascript:

         $(function () {
            //Set the hubs URL for the connection
            $.connection.hub.url = "http://localhost:8089/signalr";                

            // Declare a proxy to reference the hub. Declare queryString param
            $.connection.hub.qs = "param" + urlParams['param'];
            $.connection.hub.start();
...

On server side i am using:

   public override Task OnConnected()
   {
        var queryStr = Context.QueryString["param"];

        if (queryStr == value )
           DoSmth();
        else DoSmth2();
   }

I need to pass parameter "param" using QueryString from Windows Form App. I need something like : $.connection.hub.qs = "param" + urlParams['param']; but for Windows Form app. How to do it?

Upvotes: 0

Views: 9383

Answers (1)

Dmitry Kazakov
Dmitry Kazakov

Reputation: 1669

I solved it. I found this: "We have a bug in our logic that builds the url. We'll fix this for 0.5.3." If you want to work around it for now you can append /signalr to the url:

var connection = new HubConnection("http://localhost/signalr", "a=b");

https://github.com/SignalR/SignalR/issues/581

Upvotes: 9

Related Questions