INNER CODE UNIT · JavaScript
isConnectionValid
bvisible/mcp-ssh-manager · src/index.js:386
async function isConnectionValid(ssh) {
try {
return await ssh.ping();
} catch (error) {
logger.debug('Connection validation failed', { error: error.message });
return false;
}
}
// Setup keepalive for a connection
function setupKeepalive(serverName, ssh) {
// Clear existing keepalive if any
if (keepaliveIntervals.has(serverName)) {
clearInterval(keepaliveIntervals.get(serverName));
}
// Set up new keepalive interval
const interval = setInterval(async () => {