writer = new WriterThread(); writer.start();
public void close() { go.set(false); // Kill the writer service writer.shutdown(); if( connector.isConnected() ) { // Kill the connector connector.close(); } }
public void run() { while( go.get() ) { try { ByteBuffer data = outbound.take(); write(data); } catch( InterruptedException e ) { if( !go.get() ) return; throw new RuntimeException( "Interrupted waiting for data", e ); } } } }
writer = new WriterThread(); writer.start();
writer = new WriterThread(); writer.start();
public void run() { while( go.get() ) { try { ByteBuffer data = outbound.take(); write(data); } catch( InterruptedException e ) { if( !go.get() ) return; throw new RuntimeException( "Interrupted waiting for data", e ); } } } }
public void run() { while( go.get() ) { try { ByteBuffer data = outbound.take(); write(data); } catch( InterruptedException e ) { if( !go.get() ) return; throw new RuntimeException( "Interrupted waiting for data", e ); } } } }
public void shutdown() { interrupt(); }
public void shutdown() { interrupt(); }
public void close() { go.set(false); // Kill the writer service writer.shutdown(); if( connector.isConnected() ) { // Kill the connector connector.close(); } }
public void close() { go.set(false); // Kill the writer service writer.shutdown(); // Kill the connector connector.close(); }
public void shutdown() { interrupt(); }