title: SocketException Connection Reset
body: <p>I created a server which accept TCP connection . After connected to socket it looping for reading data from input stream. </p>
  
  <p><strong>Steps:</strong></p>
  
  <ol>
  <li>I started my server.</li>
  <li>Start Client.</li>
  </ol>
  
  <p>Now I am closing client.</p>
  
  <p>Then Server gives me SocketException  Connection Reset</p>
  
  <p>How do I check that my client is alive or not before reading from input stream.</p>