@Override public void close() throws IOException { channel.close(); }
void handlePreAuthCloseRequest() { try { terminateHeartbeat(); synchronized (getLock()) { connection.close(); } } catch (IOException e) { Messages.conn.debug("Error closing remoting channel", e); } }
protected void closeAction() throws IOException { try { if (!conduit.isWriteShutdown()) { conduit.terminateWrites(); } if (!conduit.isReadShutdown()) { conduit.terminateReads(); } conduit.flush(); conduit.markTerminated(); streamConnection.close(); } catch (Throwable t) { // just make sure the connection is not left inconsistent try { if (!conduit.isReadShutdown()) { conduit.terminateReads(); } } catch (Throwable ignored) {} try { conduit.markTerminated(); streamConnection.close(); } catch (Throwable ignored) {} throw t; } }
/** {@inheritDoc} */ @Override protected void closeAction() throws IOException { if (tls) { try { getSinkChannel().getConduit().truncateWrites(); } catch (IOException e) { try { getSourceChannel().getConduit().terminateReads(); } catch (IOException ignored) { } safeClose(connection); throw e; } try { getSourceChannel().getConduit().terminateReads(); } catch (IOException e) { safeClose(connection); throw e; } } connection.close(); }
@Override public void close() throws IOException { channel.close(); }
@Override public void close() throws IOException { channel.close(); }
public class play extends GameCanvas { StreamConnection connection; PrintStream output; InputStream in; ... private void closeCrapi(){ try{ output.close(); in.close(); connection.close(); }catch(IOException ex){} }
void getViaStreamConnection(String url) throws IOException { StreamConnection c = null; InputStream s = null; try { c = (StreamConnection)Connector.open(url); s = c.openInputStream(); int ch; while ((ch = s.read()) != -1) { ... } } finally { if (s != null) s.close(); if (c != null) c.close(); } }
private StreamConnection bConn = null; private DataOutputStream dos = null; try { bConn = (StreamConnection) Connector.open(PrinterURL); dos = (DataOutputStream)bConn.openDataOutputStream(); dos.writeUTF("\r\n"); dos.writeUTF("===============================");dos.writeUTF("\r\n"); dos.writeUTF(" GSECL Bill"); dos.writeUTF("\r\n"); dos.writeUTF("===============================");dos.writeUTF("\r\n"); } catch ( Exception e ) { System.out.println "Server Error: " + e.toString() ); finally { try { dos.close(); bConn.close(); } catch ( Exception e ) { } }
StreamConnection c = null; InputStream is = null; try { StringBuffer sb = new StringBuffer(); c = (StreamConnection) Connector.open( "http://www.cnn.com.br/", Connector.READ_WRITE); is = c.openInputStream(); InputStreamReader r = new InputStreamReader(is, "UTF-8"); System.out.println(r.read()); } catch (IOException ex) { ex.printStackTrace(); } finally { if (is != null) { try { is.close(); } catch (Exception ex) { System.out.println("Failed to close is!"); } } if (c != null) { try { c.close(); } catch (Exception ex) { System.out.println("Failed to close conn!"); } } }
s.close(); } catch(Exception e) { }
LocalDevice localDevice = LocalDevice.getLocalDevice(); localDevice.setDiscoverable(DiscoveryAgent.GIAC); // Advertising the service String url = "btspp://localhost:" + device_UUID + ";name=BlueToothServer"; StreamConnectionNotifier server = (StreamConnectionNotifier) Connector.open(url); StreamConnection connection = server.acceptAndOpen(); // Wait until client connects //=== At this point, two devices should be connected ===// DataInputStream dis = connection.openDataInputStream(); char c; while (true) { c = dis.readChar(); if (c == 'x') break; } connection.close();
LocalDevice localDevice = LocalDevice.getLocalDevice(); localDevice.setDiscoverable(DiscoveryAgent.GIAC); // Advertising the service String url = "btspp://localhost:" + device_UUID + ";name=BlueToothServer"; StreamConnectionNotifier server = (StreamConnectionNotifier) Connector.open(url); StreamConnection connection = server.acceptAndOpen(); // Wait until client connects //=== At this point, two devices should be connected ===// DataInputStream dis = connection.openDataInputStream(); char c; while (true) { c = dis.readChar(); if (c == 'x') break; } connection.close();
@Override protected void doClose() throws Exception { closed = true; StreamConnection conn = connection(); if (conn != null) { suspend(conn); conn.close(); } }
output.flush(); output.close(); connection.close(); } catch (Exception e) {
void handlePreAuthCloseRequest() { try { terminateHeartbeat(); synchronized (getLock()) { connection.close(); } } catch (IOException e) { Messages.conn.debug("Error closing remoting channel", e); } }
BufferedReader bReader = new BufferedReader(new InputStreamReader(inputStream)); String lineRead = bReader.readLine(); connection.close(); inputStream.close(); notifier.close();
protected void closeAction() throws IOException { try { if (!conduit.isWriteShutdown()) { conduit.terminateWrites(); } if (!conduit.isReadShutdown()) { conduit.terminateReads(); } conduit.flush(); conduit.markTerminated(); streamConnection.close(); } catch (Throwable t) { // just make sure the connection is not left inconsistent try { if (!conduit.isReadShutdown()) { conduit.terminateReads(); } } catch (Throwable ignored) {} try { conduit.markTerminated(); streamConnection.close(); } catch (Throwable ignored) {} throw t; } }
/** {@inheritDoc} */ @Override protected void closeAction() throws IOException { if (tls) { try { getSinkChannel().getConduit().truncateWrites(); } catch (IOException e) { try { getSourceChannel().getConduit().terminateReads(); } catch (IOException ignored) { } safeClose(connection); throw e; } try { getSourceChannel().getConduit().terminateReads(); } catch (IOException e) { safeClose(connection); throw e; } } connection.close(); }