I want to write a kind of "diagnostic function" which is able to detect when a TCP/IP based network is interrupted.
I would like to connect two endpoints and detect when an established connection between them two is dropped. The network connection can be wired or wireless. The check should be independent of operating system or network driver function: I don't want to read "packet retry counters" or similar because I think this won't work out. The diagnosis should run for hours or even days so when the connection gets dropped I should be able to detect this, increase a count and then reestablish the connection for further measurements.
My first idea was to use Netty or Mina but I failed because they reestablish connections silently (which normally is a good thing) I need a pointer in the right direction.