How to reproduce a silently dropped TCP/IP connection?
Use Socat to forward your connection (it's very easy to set up as a TCP forwarder/proxy) even on the same machine if you want (by introducing a new port for the proxy to operate on and pointing it to the 'official' endpoint)
Check out the simple TCP forwarder example
Then when you want to test outages you can either kill it (and the socket will be closed) or potentially try stopping the process (CTRL Z linux) to see how your destination handles stalled connections.
Any questions? I'll try to answer... Good luck!
How long can a TCP connection stay open?
There is no limit in the TCP connection itself. Client and server could in theory stay connected for years without exchanging any data and without any packet flow. Problems are usually caused by middleboxes like NAT router or firewalls which keep a state and expire the state after some inactivity. Any new packets sent within the connection cannot be delivered then because no associated state exists anymore in the middlebox.
Related Topics
Is Multi-Thread Output from System.Out.Println Interleaved
Illegalargumentexception or Nullpointerexception For a Null Parameter
How to Validate an Xml File Against an Xsd File
How to Convert an Arraylist Containing Integers to Primitive Int Array
Looking for a CSS Parser in Java
Compound Class Names Are Not Supported Error in Webdriver
How to List Target Platforms. Please Make Sure the Android Sdk Path Is Correct
Android: How to Enable/Disable Wifi or Internet Connection Programmatically
Maximum Length of Intent Putextra Method? (Force Close)
How to Parse a Local JSON File from Assets Folder into a Listview
Android Jdbc Not Working: Classnotfoundexception on Driver
How to Use Linux Shared Libraries in Java
Commons Vfs and Java.Net.Url - Adding Support for "Sftp://" Protocol
Local_Policy.Jar and Us_Export_Policy.Jar Different with Unlimited Strength VS Default
Create a Shell Script to Run a Java Program on Linux