Ejemplo n.º 1
0
 private void closeIO() {
   try {
     mIn.close();
   } catch (Exception e) {
     /*
      * May fail if the connection is already closed.
      */
   }
   try {
     mOut.close();
   } catch (Exception e) {
     /*
      * May fail if the connection is already closed.
      */
   }
   try {
     mSocket.close();
   } catch (Exception e) {
     /*
      * May fail if the connection is already closed.
      */
   }
   mIn = null;
   mOut = null;
   mSocket = null;
 }
Ejemplo n.º 2
0
 private void writeLine(String s) throws IOException {
   mOut.write(s.getBytes());
   mOut.write('\r');
   mOut.write('\n');
   mOut.flush();
 }