SignalR과 MVC를 사용하는 간단한 채팅 클라이언트 프로젝트가 있습니다.이 프로젝트는 ASP.Net One과 거의 동일합니다. (저는 단지 실험 중이며 클라이언트 코드는 동일합니다). 가 발생할 때 나는 것을 볼 수있는 다음을 유선했습니다SignalR connection error
$.connection.hub.stateChanged(function(state){console.log(state)});
연결이 잘 작동하지만 난 크롬에서 콘솔을 IIS Express를 종료하고 볼 경우, 나는이를 볼 것으로 나타났습니다 :
//As you would expect the state goes from connected to connecting
Object {oldState: 1, newState: 2}
//Then it times out after about 30 secs and throws this awesomeness at the console
WebSocket connection to 'ws://localhost:61623/signalr?transport=webSockets&connectionToken=VDF640emz7PFMToC6vxle_5-7QS5dZMszV4SPbQO7EFEmSSsITnwKsZreqfl4MGq8TXitG2xB5F-2ZdHp-2t3shPzN2hemTY1ZmEWlB8NOn5orUVexaSoARk9XjEO5B00&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D&messageId=B%2C7%7CL%2C0%7CM%2C0%7CN%2C0&tid=0' failed: WebSocket is closed before the connection is established. jquery.signalR-1.0.1.js:1117
//Reconnecting to Disconnecting - so why the error above?
Object {oldState: 2, newState: 4}
//Then radio silence if I start IIS again...
2 개 질문 : 시도 재 연결이 실패 할 때
어떻게 오류를 방지합니까?
왜 SignalR은 IIS에 계속 연결하려고하지 않습니까? 나는이 기술의 지점이었다 인상 ...
편집에서였다 같은 일이 너무
문제가 도움이되는지 확실하지 않은 경우 https://github.com/SignalR/SignalR/Support/SignalR/wiki/Configuring-SignalR –
@TimBJames - 감사합니다. Tim, 시간 초과와 관련이 있습니다. 서버가 폭발하고 응답을 멈추는 경우 시간 초과가 발생해도 상관 없습니다. 나는 단지 클라이언트 측 오류를 우아하게 처리하려고한다 :-) – Rob
[JabbR] (https://jabbr.net/#/rooms/signalr)에서이 질문에 대한 링크를 붙이면 도움이 될만한 사람이있을 수있다. . –