title: what is the default time out value of java.net.Socket in android?
body: <p>I'm developing a mobile application for android. There, I creating socket and transfer data between android mobiles and windows application (which is run on pc,laptop). I'm using <strong>android 2.3</strong></p>
  
  <p>Testing mobile <strong>samsung galaxy pop</strong>
  <br>The pc and mobiles are connected via USB tithering.
  <br>The data transfer correctly.
  <br>But one problem is in the middle of application the tithering cancelled by unplug the mobile usb caple from system,then i throws exception.</p>
  
  <p>But some times it does not through any exception it simply waits,Socket also not closed waits for data for reading
  <br>So please send the default socket time out time in android</p>
  
  <p><br>My sample codes are given below</p>
  
  <pre><code>    Socket socket=null;
      DataOutputStream dos=null;
      OutputStream os=null;
      InputStream is=null;
      DataInputStream dis=null;
  
      try
      {
          Log.i(tagName, "b4 creating socket");
          socket=new Socket(this.getIpAddress(),this.getPort_number());                   
          is=socket.getInputStream();             
          dos=new DataOutputStream(os);       
          dis=new DataInputStream(is);            
      }
      catch(UnknownHostException unknown_ex)
      {
          Log.i(tagName, "Exception host unknown : "+unknown_ex.toString());
          unknown_ex.printStackTrace();           
      }
      catch(IOException ioe_ex)
      {
          Log.i(tagName, "ioe Exception : "+ioe_ex.toString());           
          ioe_ex.printStackTrace();           
      }
      catch(Exception ex)
      {
          Log.i(tagName, "Exception : "+ex.toString());       
          ex.printStackTrace();       
      }
  
      if(dos!=null)
      {
          try
          {
              dos.close();
          }
          catch(Exception ex)
          {
  
          }
      }
  
      if(dis!=null)
      {
          try
          {
              dis.close();
          }
          catch(Exception ex){}
      }
      if(socket!=null)
      {
          try
          {
              socket.close();
          }
          catch(Exception ex)
          {
  
          }
      }
  
      socket=null;dos=null;dis=null;      
      Log.i(tagName, "MySocketConnection.connectMe() - end");
  </code></pre>
  
  <p><br>When I use the code</p>
  
  <pre><code>Socket.getSoTimeout()
  </code></pre>
  
  <p><br>Then it returns 0.</p>
  
  <p><br>Please all are give your ideas.</p>