@Override
        public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) {
            SerialChannel.this.remoteAddress = remoteAddress;
            eventLoop().execute(() -> {
                try {
                    final boolean success = doConnect(remoteAddress, localAddress);
                    if (success) {
                        // Send a message to the pipeline
                        pipeline().fireChannelActive();
                        // Finally, close the promise
                        promise.setSuccess();
                    } else {
                        promise.setFailure(new RuntimeException("Unable to open the com port '" + ((SerialSocketAddress) remoteAddress).getIdentifier() + "'"));
                    }
                } catch (Exception e) {
                    promise.setFailure(e);
                }
            });
        }
Create a new instance

@param parent the parent {@link Channel} by which this instance was created. May be {@code null}
@param ch     the underlying {@link SelectableChannel} on which it operates
plc4j/transports/serial/src/main/java/org/apache/plc4x/java/transport/serial/SerialChannel.java