static protected void closePort() { if (m_Port != null) { try { m_Out.flush(); m_Port.close(); } catch (IOException e) { e.printStackTrace(); } finally { m_Port = null; } } }
static protected void closePort() { if (m_Port != null) { try { m_Out.flush(); m_Port.close(); } catch (IOException e) { e.printStackTrace(); } finally { m_Port = null; } } }
/** * @see javax.microedition.io.Connection#close() */ @Override public void close() throws IOException { try { closeResource( this.is ); closeResource( this.os ); if ( this.port != null ) { this.port.close(); } } finally { this.is = null; this.os = null; this.port = null; } }
port.close(); } catch (Throwable thwble) { thwble.printStackTrace();
super.close();
while (!m_ThreadRunning) Thread.sleep(10); m_Port.close();// do not closePort() because flushing may block m_Port = null; Thread.sleep(1000); while (!m_ThreadRunning) Thread.sleep(10); m_Port.close(); // do not closePort() because flushing may block m_Port = null; Thread.sleep(10); m_Port.close(); if (((PureJavaSerialPort) m_Port).isInternalThreadRunning()) fail("internal thread failed to stop");
/** * Disconnects from the current selected port. */ final void disconnect() { try { enableControls(); this.terminalFrontend.disconnect(); if ( this.serialPort != null ) { HostUtils.closeResource( this.serialInput ); HostUtils.closeResource( this.serialOutput ); this.serialPort.close(); } } catch ( IOException exception ) { JErrorDialog.showDialog( getOwner(), "Disconnect failed!", exception ); } finally { this.serialPort = null; this.serialInput = null; this.serialOutput = null; } }