私のWebアプリケーションでは、SignalRの動作に矛盾があります。ほとんどの場合、Webアプリケーションのいくつかのページを除いて動作しますが、IE 11とChromeでは表示されません。興味深いことに、Telerikコンポーネント(ASP.NET AJAX 2015.3.1104のUI)があるページでは動作しませんが、これが関連しているかどうかはわかりません。ここでブラウザおよび/またはWebページによっては、SignalRクライアント側が常に呼び出されるとは限りません
は私のハブのjsファイルです:
Firefoxで今$(document).ready(function() {
var connection = $.hubConnection();
connection.logging = true;
connection.start();
$.connection.eCDHub.logging = true;
//get hub
var ecdHub = $.connection.eCDHub;
//on starting page => join the ecd hub to receive notifications
$.connection.hub.start().done(function() {
ecdHub.server.joinECDHub(instId);
try{
ecdHub.server.showRequestToAll(null, 0).done(console.log("showRequestToAll"));
}
catch (err) {
console.log("error (" + err+ ")");
}
console.log("Connected to notifications (" + instId + ")");
}).fail(function (reason) {
console.log("SignalR connection failed: " + reason);
});
//on receiving ecd notification
ecdHub.client.showRequest = function (ecd) {
console.log("eCd notification received");
if (typeof displayComingRequest == 'function') {
displayComingRequest(ecd);
}
//$("#ecdAlertModel").show();
}
ecdHub.client.showRequestToAll = function (ecd) {
console.log("notification received for all");
//displayComingRequest(ecd);
//$("#ecdAlertModel").show();
}
ecdHub.client.showMessage = function (msg) {
console.log("Message received: " + msg);
}
});
私は、次の出来事を参照してください。
[12:24:31 GMT-0500 (Eastern Standard Time)] SignalR: Stopping connection. jquery.signalR-2.2.1.min.js:9:3362
[12:24:31 GMT-0500 (Eastern Standard Time)] SignalR: EventSource calling close(). jquery.signalR-2.2.1.min.js:9:3362
[12:24:31 GMT-0500 (Eastern Standard Time)] SignalR: Fired ajax abort async = false. jquery.signalR-2.2.1.min.js:9:3362
[12:24:31 GMT-0500 (Eastern Standard Time)] SignalR: Stopping the monitoring of the keep alive. jquery.signalR-2.2.1.min.js:9:3362
[12:24:33 GMT-0500 (Eastern Standard Time)] SignalR: Window unloading, stopping the connection. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5'. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport starting. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://192.168.1.251/signalr/connect?transport=serverSentEvents&clientProtocol=1.5&connectionToken=XloZHlV2pNdtdLr%2BeR%2FTDSOKICodsv7MI%2Bj1Zt7rp%2FWs8kOasiDMst9jTYB4scMJsVMEHLxX%2BH0ccG%2BAT9Iunmq2BfT5jzSGCLQALNVw%2FxMW5iPcLFQer2zCWJub5FK8NYzw3Q%3D%3D&tid=10'. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: EventSource connected. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport connected. Initiating start request. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state. jquery.signalR-2.2.1.min.js:9:3362
[12:24:37 GMT-0500 (Eastern Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000 jquery.signalR-2.2.1.min.js:9:3362
showRequestToAll hubs.js:25:58
Connected to notifications (101) hubs.js:30:9
notification received for all
だから、明らかに私のクライアント側のメソッドshowRequestToAll()が呼び出されます。
[12:24:29 GMT-0500 (Eastern Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5'.jquery.signalR-2.2.1.min.js:9
[12:24:29 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport starting.jquery.signalR-2.2.1.min.js:9
[12:24:30 GMT-0500 (Eastern Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://192.168.1.251/signalr/connect?transport=serverSentEvents&clientProto…nZfR%2F6CVhvHqokc6b6DmNjsrPshxkAfZgCZr1Bcn0P%2FQGz5oe7SRc63F3w%3D%3D&tid=6'.jquery.signalR-2.2.1.min.js:9
[12:24:30 GMT-0500 (Eastern Standard Time)] SignalR: EventSourceconnected.jquery.signalR-2.2.1.min.js:9
[12:24:30 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport connected. Initiating start request.jquery.signalR-2.2.1.min.js:9
[12:24:30 GMT-0500 (Eastern Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.jquery.signalR-2.2.1.min.js:9
[12:24:30 GMT-0500 (Eastern Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000 hubs.js:25
showRequestToAll hubs.js:30
Connected to notifications (101)
とIE11で:しかし、クロムは例えば、私はこれを見
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5'.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport starting.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: This browser doesn't support SSE.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents transport failed to connect. Attempting to fall back.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: foreverFrame transport starting.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: Binding to iframe's load event.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: foreverFrame transport connected. Initiating start request.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.
[12:24:40 GMT-0500 (Eastern Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332, keep alive timeout of 20000 and disconnecting timeout of 30000
showRequestToAll
Connected to notifications (101)
[12:24:45 GMT-0500 (Eastern Standard Time)] SignalR: foreverFrame transport timed out when trying to connect.
ブラウザ間で何が起こっているの任意のアイデア?他のページでは、IEとChromeで正常に動作します。 FFでどこでも動作するようです。