Skip to content

Commit

Permalink
Fixed serial port implementation
Browse files Browse the repository at this point in the history
NioEventLoopGroup causes an IllegalStateException because it's not
compatible with serial port channels (serial port channels require
one thread per channel)
  • Loading branch information
Rainer Hitz committed Jan 2, 2020
1 parent 052840b commit adcb46c
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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.