title: new ObjectInputStream() blocks
body: <pre><code>public class SerProg {
  
  
      static ServerSocket ser=null;
      static Socket cli=null;
      static ObjectInputStream ins=null;
      static ObjectOutputStream outs=null;
  
  
      public static void main(String[] args) {
  
          try {
  
              ser=new ServerSocket(9000,10);
              cli=ser.accept();
  
              System.out.println("Connected to :"+cli.getInetAddress().getHostAddress()+" At Port :"+cli.getLocalPort());
  
              ins=new ObjectInputStream(cli.getInputStream());
              outs=new ObjectOutputStream(cli.getOutputStream());
  
              String str=(String)ins.readObject();
  
  
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
      }
  
  }
  </code></pre>
  
  <p>And the Client</p>
  
  <pre><code>public class SerProg {
  
      /**
       * @param args
       */
      static ServerSocket ser=null;
      static Socket cli=null;
      static ObjectInputStream ins=null;
      static ObjectOutputStream outs=null;
  
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
          try {
  
              ser=new ServerSocket(9000,10);
              cli=ser.accept();
  
              System.out.println("Connected to :"+cli.getInetAddress().getHostAddress()+" At Port :"+cli.getLocalPort());
  
              ins=new ObjectInputStream(cli.getInputStream());
              outs=new ObjectOutputStream(cli.getOutputStream());
  
              String str=(String)ins.readObject();
  
  
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
      }
  
  }
  </code></pre>
  
  <p>The Connection is established successfully but in the Server Code Line </p>
  
  <pre><code>ins=new ObjectInputStream(cli.getInputStream());
  </code></pre>
  
  <p>the code halts and does not proceed,what might be the problem ??</p>