SignalR Connect Returns 504 -
SignalR Connect Returns 504 -
i have weird behavior going on signalr, have hub defined so:
public class notificationhub : hub { //empty }
on js have following:
function blabla { // bla bla $.connection.notificationhub.client.appendnewstory = function (story) { // appends new story, long jquery code }; $.connection.hub.start().done(function () { _connectionstarted = true; // there must built in way }); }
i phone call js class on mvc project
public someclass { private ihubcontext _context; public someclass() { _context = globalhost.connectionmanager.gethubcontext<notificationhub>(); } public void notify(somedata ...) { _context.clients.user(userid).appendnewstory(data); } }
problem has 2 symptoms:
server client class fail intermittently (can't figure out scenario). my web server seems slow, subsequent ajax calls , regular webrequests timeout.using fiddler found following:
signalr/hubs phone call succeeds. signalr negotial phone call succeeds. connect websockets transport failed http 504! subsequent connect calls seek foreverframe , long polling, both succeed 200. a poll request issued , never returns! after becomes slow or hangs.something might aid debugging, server hangs if i'm opening 2 tabs or more. single tab seems ok.
i'm using ie 11 , chrome, same problem except chrome tries serversentevents instead of foreverframe.
any ideas on how debug issue, see why 504? or why server hangs? have windows 8.1 update 1, iis 8, signalr 2.0, .net 4.5.1.
did install websockets in windows 8.1? under add/remove features. had similar random issues connecting until did this. had enable next setting in web.config:
<add key="aspnet:usetaskfriendlysynchronizationcontext" value="true"/>
signalr
Comments
Post a Comment