I'd like to check if a connection using the telnetlib is still up.
The way I do it is to send a ls
command and check the answer, but I'm sure there must be a smoother solution.
I'd like to check if a connection using the telnetlib is still up.
The way I do it is to send a ls
command and check the answer, but I'm sure there must be a smoother solution.
I've got the idea from here, so kudos to them, the code could be something like this
the idea is pretty simple:
I've used this method for both direct and proxied(SocksiPy) connections against a couple of Cisco routers