Code: Select all
$.connection.hub.disconnected(function () {
console.log("tryReConnect..");
setTimeout(function () {
$.connection.hub.start().done(function () {
console.log("ReConnect..");
ApplyTicker();
});
}, 5000); // Restart connection after 5 seconds.
});
CandlestickChart?rperiod=week&period=15&ticker=USDT-BTC:479 GET https://****/signalr/negotiate?clientProtocol=1.5&connectionToken=NbVledowCs%2FwoSru1LHMhlN55W%2BF97pirXUhJGiZSrfQpXyEAmrFKN1WlCp847bI4Cw928b%2BMZym307TE31%2FdrFLX7Z7X9TvVvc4cntx%2B7hftfr9qTgSb6mNiUZkVeph&connectionData=%5B%7B%22name%22%3A%22candleshub%22%7D%5D&_=1517167495627 net::ERR_CONNECTION_REFUSED
На 9-ом пишет вот что
И сообытие срабатывает. Но если до сервера достучалось раньше, то и коннект оборван, и событие не прошло. Как можно сделать, что бы на этих 8-ми событиях ивент срабатывал?WebSocket connection to 'wss://****/signalr/reconnect?transport=webSockets&groupsToken=QnbiOrdO2xM%2FYhXM%2BFHtFuuUTFM8CtPj1iMFWgb9JtMgTiJ0C%2BkO5D6xjX%2FK7erpUBYMB%2FNZ5fM4f%2BVCN07a20C%2BRQRBF3jEwv1rgYJVGotd1Gqu4P8nomK9eyKawvN15%2F9BcVCGJpi3fD5K6awi8wKpoAuS6oDmxF2fj%2BkOsIQ%3D&messageId=d-62CBC0CB-B%2C0%7CGi%2C0%7CGT%2C0%7CGj%2C2%7Cm%2C457&clientProtocol=1.5&connectionToken=NbVledowCs%2FwoSru1LHMhlN55W%2BF97pirXUhJGiZSrfQpXyEAmrFKN1WlCp847bI4Cw928b%2BMZym307TE31%2FdrFLX7Z7X9TvVvc4cntx%2B7hftfr9qTgSb6mNiUZkVeph&connectionData=%5B%7B%22name%22%3A%22candleshub%22%7D%5D&tid=4' failed: WebSocket is closed before the connection is established.