Skip to content
Permalink
Browse files

Fixed serial port implementation

NioEventLoopGroup causes an IllegalStateException because it's not
compatible with serial port channels (serial port channels require
one thread per channel)
  • Loading branch information
rainerhitz committed Jan 2, 2020
1 parent 052840b commit adcb46c206117765391cf1cc999817afead47e46
Showing with 3 additions and 2 deletions.
  1. +3 −2 agent/src/main/java/org/openremote/agent/protocol/serial/SerialIoClient.java
@@ -21,7 +21,7 @@

import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.oio.OioEventLoopGroup;
import org.openremote.agent.protocol.ProtocolExecutorService;
import org.openremote.agent.protocol.io.AbstractNettyIoClient;
import org.openremote.agent.protocol.io.IoClient;
@@ -64,8 +64,9 @@ public String getClientUri() {
return "serial://" + port;
}

@SuppressWarnings("deprecation")
@Override
protected io.netty.channel.EventLoopGroup getWorkerGroup() {
return new NioEventLoopGroup(1);
return new OioEventLoopGroup(1);
}
}

0 comments on commit adcb46c

Please sign in to comment.
You can’t perform that action at this time.