title: reading string from socket error-connection reset error
body: <pre><code>java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(is));
  
  String cmd=null;
  while(is.available()&lt;1){}
  cmd = br.readLine();
  
  System.out.println("cmd: "+cmd);
  
  if(cmd.equals("search")){
  
      String[] param = br.readLine().split(",");
  
      for(String s:param){
          System.out.println(s);
      }
  </code></pre>
  
  <p>this the client code which accepts a string sent by server.but an exception is thrown in the line <code>cmd=br.readLine()...</code> a connection reset error..</p>
  
  <p>server code is</p>
  
  <pre><code>Socket(InetAddress.getLocalHost(),1234);
  OutputStream os = s.getOutputStream();InputStream is=s.getInputStream();
  java.io.BufferedWriter bw=new java.io.BufferedWriter(new java.io.OutputStreamWriter(os)); 
  String ss="search";
  bw.println(ss);
  bw.flush();
  System.out.println("search cmded");        
  
  String param = "a,*,0,-1";
  bw.println(param);
  bw.flush();
  System.out.println("param sent");
  </code></pre>
  
  <p>i've tried using print writer and the bufferedwriter but nothing is working correctly
  so what could be the possible solution ???</p>
  
  <p>also one thing worth mentioning is im using a listener service which creates a new server code mentioned above to handle particular client requests...
  so wot could be soln now ??</p>