title: I Can't read from the server-side socket
body: <p>First of all, the android application will connect to the server (PC).
  Then the android will send a message.
  And finally the android application should receive a message from the server.</p>
  
  <p>When I send the message from the android to the Server, everything goes well.
  However, when it comes to reading from socket inside the android app, I can't receive anything.</p>
  
  <p>Here is the Server code</p>
  
  <pre><code>    ServerSocket Sock = new ServerSocket(7777);
      System.out.println("Waiting for connection...\n");
      Socket connectionSocket = Sock.accept();
      System.out.println("Client In...");
      BufferedReader inFromClint = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
      PrintWriter printwriter = new PrintWriter(connectionSocket.getOutputStream());
      String txt = inFromClint.readLine();
      System.out.println(txt);
      String MsgToClient = "{\"LoginFlag\":\"N\"}";  //{"LoginFlag":"P"}
      printwriter.write(MsgToClient);
      printwriter.flush();
      printwriter.close();
      System.out.println("\nMsg Sent");
      Sock.close();
  </code></pre>
  
  <p>And this is sample of the Android app:</p>
  
  <pre><code>new Thread(new Runnable() {
      @Override
      public void run() {
         try
            {
               BufferedReader bufferedReader = null;
               PrintWriter printwriter = null;
               port = 7777;
                client = new Socket("192.168.1.2", port);
                printwriter = new PrintWriter(client.getOutputStream());
                printwriter.write(SMsgLog);
                printwriter.flush();
                printwriter.close();
                bufferedReader = new BufferedReader(new InputStreamReader(client.getInputStream()));
                if( bufferedReader.ready() )
                {
                    RJasonLog = bufferedReader.readLine();   //rcv as jason
                }
                else
                {
                   RJasonLog = null;
                }
                if (RJasonLog != null)
                {
                   JSONObject objectRcv = new JSONObject(RJasonLog);
                    if (objectRcv != null)
                    {
                       RMsgLog = objectRcv.getString("LoginFlag");  //Jason Key from the server
                     }
                 }
                 RMsgLog = "N";
                 if(RMsgLog.equals("N"))
                 {                                     
                    alert.showAlertDialog(Login.this, "Login failed..", "Username/Password is incorrect", false);
                 }
                  else
                        alert.showAlertDialog(Login.this, "Login failed..", "Please Try Again", false);
  
  
                 client.close();
             }
  
             catch (IOException e) {
                  e.printStackTrace();
              } catch (JSONException e) {
                  e.printStackTrace();
              }
       }
   }).start();
  </code></pre>