2

Trying to get SignalR working on the webserver(IIS 8, Server 2012, websockets installed, .NET 4.5) but having no joy.

Works great on my local IIS(windows 8 and connects with websockets)

<httpRuntime targetFramework="4.5"/> 

and

<compilation strict="false" explicit="true" targetFramework="4.5" debug="false"> 

Set in webconfig

Local signalr logging:

[11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'. [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'. [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting. [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:22038/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=W5PmClxV6R32xJpuP5It2NUDVvJXOESGJCrgQYb67z59ODUJFr13zQzgBgTYEfmr4XbgMmRGU3ZncQS3yZU2Hmh%2Fc3h%2F17fh9gRlUOUdnaVYcnls%2BQon%2F7R0ckNw8MnLcrG1pg%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=3'. [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened. [11:26:17 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport connected. Initiating start request. [11:26:18 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state. [11:26:18 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000 hub start, connection id=01b7a623-5531-496c-a5e1-ab0876e2c1a6 

Server log:

[11:24:01 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'. [11:24:01 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'. [11:24:02 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting. [11:24:02 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://foo.co.uk/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=uibfnMomSreytNZY7UiusFWoTjNWO6%2FNIaBzIM%2FVVSBOXk6SNlyULUH%2FaGWoPynoEbx6sKRfShJG0zrd846uqgdgEK6xQIP2K5j3xfwtBlngGG3i6k%2FYoHNk5subReA3TsCxfw%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=10'. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened. SCRIPT12030: WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Unclean disconnect from websocket: [no reason given]. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Closing the Websocket. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport failed to connect. Attempting to fall back. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: serverSentEvents transport starting. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: This browser doesn't support SSE. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: serverSentEvents transport failed to connect. Attempting to fall back. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: foreverFrame transport starting. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Binding to iframe's load event. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Iframe transport started. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: foreverFrame transport connected. Initiating start request. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state. [11:24:03 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000 hub start, connection id=cd2af7f4-5f85-40bb-a0a6-f8f8060bedae 

Even though it appears to be connected using foreverFrame it does not fire the appropriate hub responses.

2 Answers 2

1

Nondescript errors like this can occur if there are JSON serialization problems on the server. I would expect a proper exception for most normal exceptions.

In my case I made a really stupid mistake and had TWO properties with the same JsonProperty name in my return message (server side). Basically a cut and paste error that took a while to be noticed because 'SuggestedCities' wan't always populated.

public class ValidateZipStateResponse { [JsonProperty("correctedCity")] public string CorrectedCity { get; set; } [JsonProperty("correctedState")] public string CorrectedState { get; set; } [JsonProperty("correctedState")] public string[] SuggestedCities { get; set; } } 

Make sure client side you enable debugging. It won't help with this error, but in general it's quite useful and you'll see a useful log in the browser console.

$.connection.hub.logging = true; 
Sign up to request clarification or add additional context in comments.

Comments

0

After trying the website on my home connection I found it connected to websockets fine.

So I am going to assume there is some kind of Proxy server inbetween my "work" pc and the web server. Of which I have no access to. (Assuming Proxy server over Firewall here).

[10:33:15 GMT+0000 (GMT Standard Time)] SignalR: Client subscribed to hub 'notificationhub'.

[10:33:15 GMT+0000 (GMT Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport starting. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Connecting to websocket endpoint 'ws://blah/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=IxxvgxBhvbsruv2uk0pK%2FPB708bJGvoOJD0oR0vVPgBip%2B7uGy68HEMOw1ikq7%2BuiyX7XqN%2FwYK%2BKgkrBlz9HHuI5HSDQEwRHvSr2Ey1pg2B7FaviRLFcNu8mg2dRWHVKbAkdw%3D%3D&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=6'. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Websocket opened. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: webSockets transport connected. Initiating start request. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state. [10:33:16 GMT+0000 (GMT Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000 hub start, connection id=7f3eba16-9e7b-450e-a740-a69fa91047b6

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.