0
votes

I have a website web.glidertracking.co.uk which seems to work well but after a short time it stops working.

In Firefox on the console I get the message

Firefox can't establish a connection to the server at ws://web.glidertracking.co.uk/signalr/reconnect?transport=webSockets&messageId=d-F12111CE-A%2C2F76%7CE%2C0%7CF%2C1%7CG%2C0&clientProtocol=1.4&connectionToken=9rtmojkUsiTz1k1hGHAHq5NDVy%2Fs96KyNyrvR1YDeHsqqraESwr4ky2waZfL4MRhFykwSxLEsdKMGQkKiH6Pkd7AZ%2BF1CqjuyN0xKcgxWb9PldJXF0ILOOw4JEE7A7wZ&connectionData=%5B%7B%22name%22%3A%22aprshub%22%7D%5D&tid=8. jquery.signalR-2.1.1.js:1622:36 This is repeated several times as the page tries to reconnect.

In Chrome the same thing happens with the message

WebSocket connection to 'ws://web.glidertracking.co.uk/signalr/reconnect?transport=webSockets&messageId=d-50D0B86A-A%2C42E5%7CH%2C0%7CI%2C1%7CJ%2C0&clientProtocol=1.4&connectionToken=088xfYgsm2yPs1Ig2VxFqLBuwlLoKtDPWl9FKEMr3%2Bt%2F%2F56DEnBqXBQiVoG93tfRPTxprdtPtKBGnKCAyDZfpy3Z1pw1pRiz6kxAGapXXoAhUDmeCQePBXVcdltFrfgh&connectionData=%5B%7B%22name%22%3A%22aprshub%22%7D%5D&tid=0' failed: Error during WebSocket handshake: Unexpected response code: 400

Can anyone Help me. What is going wrong?

I would be happy to provide the code for the whole site but there is a lot of code!

1

1 Answers

1
votes

Had similar issue, SignalR connection was ok, but re-connect fail with Unexpected response code: 404, or (after some manipulations with web.config) with Unexpected response code: 400.

Solved after checking & changing limitations for maxQueryStringLength, maxUrlLength, maxQueryString. in the Web.Config:

<system.web>
 <httpRuntime maxQueryStringLength="32768" maxUrlLength="65536"/>
 <security>
  <requestFiltering>
    <requestLimits maxQueryString="32768"/>
  </requestFiltering>
</security>
<system.web/>

Values "32768" & "65536" just for example, check and test your own.

P.S.In our case, we had a long query string, because we send all the hub's names to the server thinking that it is necessary for reconnect. But after all we saw, that it was no nessesary.