Java:Is there a way to read the inputstream for a specific amount of time
<p>I've a situation where a thread opens a telnet connection to a target m/c and reads the data from a program which spits out the all the data in its buffer. After all the data is flushed out, the target program prints a marker. My thread keeps looking for this marker to close the connection (successful read).</p>

<p>Some times, the target program does not print any marker, it keeps on dumping the data and my thread keeps on reading it (no marker is printed by the target program).</p>

<p>So i want to read the data only for a specific period of time (say 15 mins/configurable). Is there any way to do this at the java API level?</p>
