Resolved continuous socket.io polling issues

Resolved continuous socket.io polling issue by restricting the retry mechanism to 2.
Removed geometry POST message as part of socket.io. We are sending this info by websocket transport.
This commit is contained in:
bendalam 2019-11-14 12:50:09 +05:30
parent 6bc2694887
commit ed4b1bf099
2 changed files with 7 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -13,6 +13,7 @@ require('xterm/css/xterm.css')
require('../css/style.css')
/* global Blob, logBtn, credentialsBtn, reauthBtn, downloadLogBtn */
var geometrySent = false
var sessionLogEnable = false
var loggedData = false
var allowreplay = false
@ -22,7 +23,7 @@ var termid // eslint-disable-line
// change path here and in the /app/server/app.js line 115
var resource = window.location.search
var custom_path = '/f5-webssh/socket.io'
var socket = io({ path: custom_path , query: resource.substring(1)})
var socket = io({ path: custom_path , query: resource.substring(1), reconnectionAttempts: 2 })
var term = new Terminal()
const fitAddon = new FitAddon()
// DOM properties
@ -49,10 +50,13 @@ socket.on('data', function (data) {
if (sessionLogEnable) {
sessionLog = sessionLog + data
}
if (geometrySent == false) {
resizeScreen();
geometrySent = true;
}
})
socket.on('connect', function () {
socket.emit('geometry', term.cols, term.rows)
})
socket.on('setTerminalOpts', function (data) {