MCPcopy Create free account
hub / github.com/mscdex/ssh2 / sendKA

Method sendKA

lib/client.js:716–734  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

714 let kacount = 0;
715 let katimer;
716 const sendKA = () => {
717 if (++kacount > kacountmax) {
718 clearInterval(katimer);
719 if (sock.readable) {
720 const err = new Error('Keepalive timeout');
721 err.level = 'client-timeout';
722 this.emit('error', err);
723 sock.destroy();
724 }
725 return;
726 }
727 if (isWritable(sock)) {
728 // Append dummy callback to keep correct callback order
729 callbacks.push(resetKA);
730 proto.ping();
731 } else {
732 clearInterval(katimer);
733 }
734 };
735 function resetKA() {
736 if (kainterval > 0) {
737 kacount = 0;

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
pingMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected