Reputation: 268
I am building a web application using ASP.NET MVC5 and decided to implementing SignalR for notifications.
I decided to also implement it for other real time client-server interactions.
I have a follow button. When clicked it invokes a follow method and sends the ID with it.
notificationsHub.server.followAction(requestId);
I'm keeping it in the same hub for now, not sure if making it in a separate hub is better.
and I bind another server method when unfollowing.
notificationsHub.server.unfollowAction(requestId);
It works fine both actions, until it reach about 5-6 clicks then the hub disconnects for no reason.
This is the JavaScript log:
[11:30:41 GMT+0100 (W. Central Africa Standard Time)] SignalR: Invoking notificationshub.FollowAction
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: notificationshub.FollowAction failed to execute. Error: Error: Send failed.
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: Stopping connection.
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: EventSource calling close().
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: Fired ajax abort async = true.
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: Stopping the monitoring of the keep alive.
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: Clearing hub invocation callbacks with error: Connection was disconnected before invocation result was received..
jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: notificationshub.UnfollowAction failed to execute. Error: Connection was disconnected before invocation result was received.
4jquery.signalR-2.2.1.js:82 [11:31:35 GMT+0100 (W. Central Africa Standard Time)] SignalR: notificationshub.FollowAction failed to execute. Error: Connection was disconnected before invocation result was received.
Thank you!
Upvotes: 0
Views: 508
Reputation: 268
Seems that the machine I was working needed to have webSockets protocol installed, plus this issue was fixed in the latest signalR release 4 days ago.
Upvotes: 1