Does URLConnection buffer the connection???? Not all messages going to server
<p>I'm trying to make a very simple chat server.  the back-end is a java server i wrote and the front end is on both iphone and android.  The iphone works fine, but only on the android only like 1/2 the new chats get sent through.</p>

<p>I set a break point on the server i wrote after the accept new connection.  I then set a break point where the android sends a new message.  It seems like when the android sends a new message, the server is only seeing like...half of the connections.  </p>

<p>when the android break point goes off sometimes and i step through the code, the break point after the accept does not go through, whet it seems like everything works and it reads in the data from the server.</p>

<p>could the usrl connection class be buffering the connection, where sometimes instad of sending the message to the server it just sends back the same data as before? I'm really confuse.</p>

<p>code snippet on android
try {
    // put a break point here<br>
                                   String say="ted";
                                    URL url = new URL("http://50.63.66.138:1045/"+"add");</p>

<pre><code>                                 String data = new String(); 
                                 data="userName=c&amp;comment=hi"+say;; 

                                   URLConnection conn = url.openConnection();
                                   conn.setDoOutput(true);

                                   // send out data
                                   OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
                                   wr.write(data);
                                   wr.flush();
                                   wr.close();

                           // get data        
                           String line=new String();
                           String lines="";
                           int state=0;
                           BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                           while ((line= rd.readLine()  ) != null) {
                               lines=lines+line;
                           }
                           rd.close();
                           temp=lines;

                         } catch (Exception e) {
                               System.out.println("exception");
                               System.out.println(e.getMessage());
                           }                          
</code></pre>

<p>code snippet server
try{
                    // Get New Connection</p>

<pre><code>                // wait for ever on accepting new connections
                server.setSoTimeout(0); 
                connection=server.accept();
               // put break point here
                cConnection thread = new cConnection("thread3", connection);
</code></pre>
