I am using the SSH terminal component to connect to a remote device. If the connection is active, and the device is subsequently turned off (not a clean shutdown), there is no indication that the connection has been lost (the Disconnected event is not fired). The Disconnected event is fired approximately 20 seconds after the user types in some characters in the terminal window. If the user does not type in any characters, nothing happens.

Is is possible to detect if the terminal connection is no longer valid? I would like to notify our users as soon as the connection is dropped.

asked 28 Feb '10, 18:53

gerardr's gravatar image

gerardr
16
accept rate: 0%


I'm afraid that when the device is turned off, the TCP connection used by the SSH session is not properly closed (or it's actually not closed at all) and the TCP/IP stack at the client machine is not even aware of this until the SSH component tries communicating with the device (which happens when some characters are typed).

To be able to detect this kind of unclean shutdowns, you would have to be somehow "pinging" the device continuously. But it would still take 20 seconds to detect this (it looks like it takes this long for the TCP/IP stack to realize the connection is broken). If you would still like to give this a try, please let us know at suppor@rebex.net.

Please be aware that I'm only guessing - a communication log produced using a network protocol analyzer such as Wireshark that can show the communication at the TCP level would be needed to confirm this.

link

answered 01 Mar '10, 13:00

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×39
×3

Asked: 28 Feb '10, 18:53

Seen: 477 times

Last updated: 29 Mar '11, 07:22