2

I am just starting out with SignalR so forgive me if I've overlooked something super basic. My goal is to have a "holding page" for a user to sit on until a particular event has happened server side that tells that page to take the user to the next step in the process. I've created a Hub on the server that seems to work properly when the client is invoking calls on the server.

The problem is the client never receives any calls from the server and from the browser console output it appears the client never establishes the necessary connection to the hub.

I've tried this in latest Google Chrome and MS IE v11. I get the same messages logged in each browser.

Below is the browser console output from MS IE (I couldn't find an easy way to save the Chrome console output to text):

[10:32:02 GMT-0400 (Eastern Daylight Time)] SignalR: Client subscribed to hub 'signinghub'.
[10:32:02 GMT-0400 (Eastern Daylight Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.4&connectionData=%5B%7B%22name%22%3A%22signinghub%22%7D%5D'.
[10:32:02 GMT-0400 (Eastern Daylight Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:53915/signalr/connect?transport=webSockets&clientProtocol=1.4&connectionToken=orv901EJmuVZdJis9VFLBMVTl8bgZlbK5pWdAxiugZiYOCPPxytCCjewTQ%2FxcM0bMcGxDdRY6T46ApZSWnL%2BRO8kkllhVhYr1ZROWGSdyFQ2580j%2BR6lXitPVhdXncon&connectionData=%5B%7B%22name%22%3A%22signinghub%22%7D%5D&tid=8'.
[10:32:02 GMT-0400 (Eastern Daylight Time)] SignalR: Websocket opened.
[10:32:07 GMT-0400 (Eastern Daylight Time)] SignalR: webSockets timed out when trying to connect.
[10:32:07 GMT-0400 (Eastern Daylight Time)] SignalR: Closing the Websocket.
[10:32:07 GMT-0400 (Eastern Daylight Time)] SignalR: This browser doesn't support SSE.
[10:32:07 GMT-0400 (Eastern Daylight Time)] SignalR: Binding to iframe's load event.
[10:32:12 GMT-0400 (Eastern Daylight Time)] SignalR: foreverFrame timed out when trying to connect.
[10:32:12 GMT-0400 (Eastern Daylight Time)] SignalR: Stopping forever frame.
[10:32:12 GMT-0400 (Eastern Daylight Time)] SignalR: Opening long polling request to 'http://localhost:53915/signalr/connect?transport=longPolling&clientProtocol=1.4&connectionToken=orv901EJmuVZdJis9VFLBMVTl8bgZlbK5pWdAxiugZiYOCPPxytCCjewTQ%2FxcM0bMcGxDdRY6T46ApZSWnL%2BRO8kkllhVhYr1ZROWGSdyFQ2580j%2BR6lXitPVhdXncon&connectionData=%5B%7B%22name%22%3A%22signinghub%22%7D%5D&tid=4'.
[10:32:13 GMT-0400 (Eastern Daylight Time)] SignalR: Long poll complete.
[10:32:13 GMT-0400 (Eastern Daylight Time)] SignalR: Opening long polling request to 'http://localhost:53915/signalr/poll?transport=longPolling&messageId=d-65C891D3-Q%2C0%7CU%2C0%7CV%2C3%7CW%2C0&clientProtocol=1.4&connectionToken=orv901EJmuVZdJis9VFLBMVTl8bgZlbK5pWdAxiugZiYOCPPxytCCjewTQ%2FxcM0bMcGxDdRY6T46ApZSWnL%2BRO8kkllhVhYr1ZROWGSdyFQ2580j%2BR6lXitPVhdXncon&connectionData=%5B%7B%22name%22%3A%22signinghub%22%7D%5D&tid=10'.
[10:32:17 GMT-0400 (Eastern Daylight Time)] SignalR: longPolling timed out when trying to connect.
[10:32:17 GMT-0400 (Eastern Daylight Time)] SignalR: Aborted xhr request.
[10:32:17 GMT-0400 (Eastern Daylight Time)] SignalR: Stopping connection.
[10:32:17 GMT-0400 (Eastern Daylight Time)] SignalR: Fired ajax abort async = true.

I've read through the Introduction to SignalR and know that it will attempt to fail over from the most preferred communication technology to the least preferred. From what I can tell it is trying all 4 methods to communicate and failing on every one and eventually giving up with a "Stopping connection." message.

I'm using VS 2013 and IIS Express for development, SignalR v2.1.0, and ASP.NET MVC 5.

UPDATED TO INCLUDE CLIENT CODE

Below is the script in the client used to connect to the hub:

<!--Reference the SignalR library. -->
<script src="~/Scripts/jquery.signalR-2.1.0.min.js" type="text/javascript"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="~/signalr/hubs"></script>

<script>
    $.connection.hub.logging = true;

    $(function () {
        // Reference the auto-generated proxy for the hub.
        var chat = $.connection.signingHub;

        // Create a function that the hub can call back to redirect the user
        chat.client.signDocument = function () {
            // Add the message to the page.
            window.location.assign("/Signing/Initiate/" + ContractID.value + "?clientUserId=" + ClientUserId.value);
        };

        // Start the connection.
        $.connection.hub.start();
    });
</script>

MORE INFO...

I've discovered that this may be caused by a 3rd party component suite that I am using from DevExpress. I am able to follow the chat sample here and SignalR is working great. As soon as I add an MVC extension control from DevExpress the SignalR connection negotiation breaks down. I've commented on a question in their support forum here to hopefully get an answer.

Thanks for any help you can provide!

Steve
  • 279
  • 3
  • 13
  • first and foremost can you hit the signalr hub from your browser? Say http://localhost:port/signalr/hub - you should see the proxy unless you have disabled it. Also could you post your javascript on how you are connecting to the hub? – Gjohn Jun 25 '14 at 15:56
  • @Gjohn I guess the proxy may be disabled (not sure how to enable) because in Chrome I get "Protocol error: Unknown transport." message in the browser when I navigate to the /signalr/hub Url and I get a 400 Bad Request in IE. I have updated the question with the client side script that is connecting to the hub. Thanks! – Steve Jun 25 '14 at 17:35
  • @Gjohn - clarification: I was using the wrong Url for the proxy at first. After accessing the proxy Url as: (http://localhost:port/signalr/hubs) it does return the proxy. – Steve Jun 25 '14 at 18:00

1 Answers1

0

After getting some feedback from the DevExpress support team it seems the problem is with the latest release of SignalR 2.1.0. I downgraded my project to v2.0.3 and it began working fine. You can see my conversation with the DevExpress support team here.

Steve
  • 279
  • 3
  • 13