title: How to use RXTX with Netty 4?
body: <p>I'm trying to use Netty 4 with RXTX (it's not officially in Netty 3.x if I got this right).</p>
  
  <p>I think I have set up the pipeline factory correctly, but I don't get any event generated when some data is sent to the serial port (I have confirmed with CoolTerm that there is some data coming in regularly from my device).</p>
  
  <p>Here is below the code I use for testing (where <code>serialPort</code> is something like <code>/dev/tty.usbserial-A100MZ0L</code> (this is a FTDI device):</p>
  
  <pre><code>// Configure the client.
  final ExecutorService executorService = Executors.newCachedThreadPool();
  RxtxChannelFactory rxtxChannelFactory = new RxtxChannelFactory(executorService);
  ClientBootstrap bootstrap = new ClientBootstrap(rxtxChannelFactory);
  
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      public ChannelPipeline getPipeline() throws Exception {
          // Create and configure a new pipeline for a new channel.
          ChannelPipeline pipeline = Channels.pipeline();
          pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
          pipeline.addLast("decoder", new StringDecoder());
          pipeline.addLast("encoder", new StringEncoder());
          pipeline.addLast("logger", new LoggerHandler());
          return pipeline;
      }
  });
  
  // Start the connection attempt.
  ChannelFuture future = bootstrap.connect(new RxtxDeviceAddress(serialPort));
  
  // Wait until the connection is made successfully.
  Channel channel = future.awaitUninterruptibly().getChannel();
  
  BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
  boolean exit = false;
  while (!exit) {
      try {
          String line = reader.readLine();
          if ("exit".equals(line)) {
              exit = true;
          }
      } catch (IOException e) {
          // ignore
      }
  }
  
  // Close the connection.
  channel.close().awaitUninterruptibly();
  
  // Shut down all thread pools to exit.
  bootstrap.releaseExternalResources();
  </code></pre>