MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / check_ssh_alive

Function check_ssh_alive

sshuttle/client.py:784–799  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

782 mux.send(0, ssnet.CMD_HOST_REQ, str.encode('\n'.join(seed_hosts)))
783
784 def check_ssh_alive():
785 if daemon:
786 # poll() won't tell us when process exited since the
787 # process is no longer our child (it returns 0 all the
788 # time).
789 try:
790 os.kill(serverproc.pid, 0)
791 except OSError:
792 raise Fatal('ssh connection to server (pid %d) exited.' %
793 serverproc.pid)
794 else:
795 rv = serverproc.poll()
796 # poll returns None if process hasn't exited.
797 if rv is not None:
798 raise Fatal('ssh connection to server (pid %d) exited '
799 'with returncode %d' % (serverproc.pid, rv))
800
801 while 1:
802 check_ssh_alive()

Callers 1

_mainFunction · 0.85

Calls 1

FatalClass · 0.90

Tested by

no test coverage detected