Skip to content

Commit

Permalink
Backport #248
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Sep 26, 2019
1 parent cdb697b commit b91aeb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/javascript/src/main/webapp/javascript/atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@

if (_abortingConnection) {
atmosphere.util.log(_request.logLevel, ["Websocket closed normally"]);
} else if (!webSocketOpened) {
} else if (!webSocketOpened && _response.transport === 'websocket' && _request.fallbackTransport !== 'websocket') {
_reconnectWithFallbackTransport("Websocket failed on first connection attempt. Downgrading to " + _request.fallbackTransport + " and resending");

} else if (_request.reconnect && _response.transport === 'websocket' ) {
Expand Down Expand Up @@ -1730,11 +1730,12 @@
atmosphere.util.onTransportFailure(errorMessage, _request);
}

_request.transport = _request.fallbackTransport;
var reconnectInterval = _request.connectTimeout === -1 ? 0 : _request.connectTimeout;
if (_request.reconnect && _request.transport !== 'none' || _request.transport == null) {
_request.transport = _request.fallbackTransport;
_request.method = _request.fallbackMethod;
_response.transport = _request.fallbackTransport;
_response.state = '';
_request.fallbackTransport = 'none';
if (reconnectInterval > 0) {
_request.reconnectId = setTimeout(function () {
Expand Down

0 comments on commit b91aeb2

Please sign in to comment.