Class TCPIOClient<T>
java.lang.Object
org.openremote.agent.protocol.io.AbstractNettyIOClient<T,InetSocketAddress>
org.openremote.agent.protocol.tcp.TCPIOClient<T>
- All Implemented Interfaces:
IOClient<T>,NettyIOClient<T>
This is a
IOClient implementation for TCP.
Users of this IOClient are responsible for adding encoders for converting messages of type <T> to
ByteBuf (see AbstractNettyIOClient.MessageToByteEncoder) and adding decoders to convert from
ByteBuf to messages of type <T> and ensuring these decoded messages are passed back
to this client via AbstractNettyIOClient.onMessageReceived(T) (see and
{@link MessageToMessageDecoder}).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
AbstractNettyIOClient.ByteToMessageDecoder<T>, AbstractNettyIOClient.MessageToByteEncoder<T>, AbstractNettyIOClient.MessageToMessageDecoder<T> -
Field Summary
FieldsFields inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
bootstrap, channel, channelStartFuture, connectionStatus, connectionStatusConsumers, connectRetry, encoderDecoderProvider, executorService, messageConsumers, permanentError, RECONNECT_DELAY_INITIAL_MILLIS, RECONNECT_DELAY_MAX_MILLIS, workerGroup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected Class<? extends io.netty.channel.Channel>Should return a URI that uniquely identifies this client instanceprotected io.netty.channel.EventLoopGroupprotected io.netty.channel.ChannelFutureMethods inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
addConnectionStatusConsumer, addEncodersDecoders, addMessageConsumer, connect, createConnectedFuture, disconnect, doConnect, doDisconnect, getConnectionStatus, initChannel, onConnectedFutureComplete, onConnectionStatusChanged, onDecodeException, onEncodeException, onMessageReceived, removeAllConnectionStatusConsumers, removeAllMessageConsumers, removeConnectionStatusConsumer, removeMessageConsumer, scheduleDoConnect, sendMessage, setEncoderDecoderProvider, setPermanentError, toString
-
Field Details
-
host
-
port
protected int port
-
-
Constructor Details
-
TCPIOClient
-
-
Method Details
-
getChannelClass
- Specified by:
getChannelClassin classAbstractNettyIOClient<T,InetSocketAddress>
-
getClientUri
Description copied from interface:IOClientShould return a URI that uniquely identifies this client instance -
getWorkerGroup
protected io.netty.channel.EventLoopGroup getWorkerGroup()- Specified by:
getWorkerGroupin classAbstractNettyIOClient<T,InetSocketAddress>
-
startChannel
protected io.netty.channel.ChannelFuture startChannel()- Specified by:
startChannelin classAbstractNettyIOClient<T,InetSocketAddress>
-
configureChannel
protected void configureChannel()- Overrides:
configureChannelin classAbstractNettyIOClient<T,InetSocketAddress>
-