@Override public void flush(){
  super.flush();
  try {
    if (out != null) synchronized (out) {
      out.flush();
    }
  }
 catch (  SocketException se) {
    close();
  }
catch (  IOException ioe) {
    ioe.printStackTrace();
    close();
  }
}

@ Override public void flush ( ) { super . flush ( ) ; try { if ( out != null ) synchronized ( out ) { out . flush ( ) ; } } catch ( SocketException se ) { close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; close ( ) ; } }
override flush to flush the datastream after flushing packetqueue
