Link to home
Start Free TrialLog in
Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on

TelNet Time-Out Issue

I have a TelNet utility in my vb6 app for race timing to get finish times from my timing machine to my computer.  It has been working well but at the last race (one of the first I have used it for) it stopped sending data after about an hour.  Is there typically a time-out feature in TelNet and, if so, how can it be adjusted?  I can post the code if need be.
Avatar of David Favor
David Favor
Flag of United States of America image

You question name contains Telnet + your tags say SSH.

Telnet != SSH.

If you're trying to use Telnet, rather than something like libssl, to connect make a TLS (SSL) connection, than your connection will fail.

Likely best to do error trapping + reporting + add a comment with whatever error returned.
Avatar of Bob Schneider

ASKER

Thanks for the response.  The tag says SSH/Telnet.  That is an EE tag.  I understand they are different but that was the one that EE provided that seemed closest to a TelNet tag.

Again, my TelNet is functioning.  I just need to know how to ensure that it doesn't time out over the span of anywhere from 1 to 12 hours.  Any help would be much appreciated.
With ssh a simple command line option handles this.

With telnet, you'll have to issue some command, like date or pwd every few seconds, as telnet has no built in way to keep connections alive.

So you'll really require an expect script, which runs telnet for you + continually issues some command to force keepalive.

https://unix.stackexchange.com/questions/424701/how-do-i-stop-a-telnet-session-from-timing-out provides a good overview + working example.

So expect will actually run terminal for you, then login, then pump some command across the line at some frequency using interact with a timeout.

If possible, switching to ssh allows this far more cleanly, as expect scripts tend to... have there oddities, when run over long periods...
ASKER CERTIFIED SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you both so much!