title: Samsung C6112 (J2ME handset) InterruptedIOException issue
body: <p>On Samsung C6112 handset, m facing weird  problems.</p>
  
  <p>My midlet application is trying to connect to HTTPS url. (Its Hosted on IIS 6.0 Web Server with Versign certificate). </p>
  
  <p>i am sending data using POST method. After finished with writing post data, i call <strong>outputstream.flush()</strong> and  <strong>outputstream.close()</strong> method. These two method gives "<strong>InterruptedIOException</strong> or <strong>IOException:TCP open</strong>" .</p>
  
  <p>if i comment both methods i.e. .flush() and .close(), hc.openInputStream(); throws same exception.</p>
  
  <p>Following sample code, please suggest me if there is something wrong.</p>
  
  <pre><code>    InputStream is = null;
  OutputStream dos = null;
  HttpConnection hc = null;
  try {
          hc = (HttpConnection) Connector.open(url,Connector.READ_WRITE,true);
  
          byte b1[] = "Hello_World".getBytes();
  
          hc.setRequestMethod(HttpConnection.POST);
  
          dos = hc.openOutputStream();
  
          int i = 0;
          while (i &lt; b1.length) {
              dos.write(b1[i]);
              i++;
          }
          dos.write("\r\n".getBytes());
  
          dos.flush(); // gives **InterruptedIOException** or **IOException:TCP open**
          dos.close(); // gives **InterruptedIOException** or **IOException:TCP open**
  
          is = hc.openInputStream();
  
          byte b[];
          ByteArrayOutputStream bStrm = new ByteArrayOutputStream();
          int ch, downloadedData=0;
          while ((ch = is.read()) != -1) {
              downloadedData++;
              bStrm.write(ch);
          }
          b = bStrm.toByteArray();
  
      } catch (javax.microedition.pki.CertificateException ce) {
        System.out.println("CertificateException in " + ce.toString());
      } catch (SecurityException se) {
        System.out.println("SecurityException: ", se.toString());
      } catch (ConnectionNotFoundException cnfe) {
        System.out.println("ConnectionNotFoundException: ", cnfe.toString());
      } catch (IOException ioe) {
        System.out.println("IOException: ", ioe.toString() + ioe.getMessage());
      } catch (Exception e) {
        System.out.println("Exception: ", e.toString());
      } finally {
          if (hc != null) {
              try {
                  hc.close();
                  hc = null;
              } catch (Exception e) {
                  e.printStackTrace();
                  System.out.println("finally hc.close(); IOException " + e.getMessage() + "  " + e.toString());
              }
          }
  
          if(is !=null) {
              try {
                  is.close();
              } catch (Exception e) {
                  e.printStackTrace();
                  System.out.println("finally is.close(); Exception " + e.getMessage() + "  " + e.toString());
              }
          }
      }
  </code></pre>
  
  <p>Please let me know how to deal with Samsung j2me phones.</p>