Class AbstractTCPServer<T>
java.lang.Object
org.openremote.agent.protocol.io.AbstractNettyIOServer<T,io.netty.channel.socket.SocketChannel,io.netty.bootstrap.ServerBootstrap,InetSocketAddress>
org.openremote.agent.protocol.tcp.AbstractTCPServer<T>
- All Implemented Interfaces:
IOServer<T,
io.netty.channel.socket.SocketChannel, InetSocketAddress>
- Direct Known Subclasses:
TCPStringServer
public abstract class AbstractTCPServer<T>
extends AbstractNettyIOServer<T,io.netty.channel.socket.SocketChannel,io.netty.bootstrap.ServerBootstrap,InetSocketAddress>
Abstract IO Server for creating TCP socket servers that clients can connect to. Concrete implementation need
to configure the pipeline with the necessary encoders and decoders to ensure messages of type <T> are
generated/consumed at/from the end/start of the pipeline.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openremote.agent.protocol.io.IOServer
IOServer.IoServerMessageConsumer<T,
U, V> -
Field Summary
FieldsFields inherited from class org.openremote.agent.protocol.io.AbstractNettyIOServer
allChannels, bootstrap, channel, channelFuture, clientConnectionStatusConsumers, clientLimit, connectionStatus, connectionStatusConsumers, executorService, INITIAL_RECONNECT_DELAY_MILLIS, LOG, MAX_RECONNECT_DELAY_MILLIS, messageConsumers, RECONNECT_BACKOFF_MULTIPLIER, reconnectDelayMilliseconds, reconnectTask, scheduledExecutorService, workerGroup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.netty.bootstrap.ServerBootstrap
Create and configure the bootstrap to use for this instanceprotected String
getClientDescriptor
(io.netty.channel.socket.SocketChannel client) Should return a descriptor to identify the specified client for use in log files etc.protected String
Get a string identifier that uniquely identifies the current instance of this server.Methods inherited from class org.openremote.agent.protocol.io.AbstractNettyIOServer
addConnectionStatusConsumer, addConnectionStatusConsumer, addDecoder, addDecoders, addEncoder, addEncoders, addMessageConsumer, disconnectClient, getConnectionStatus, getConnectionStatus, handleMessageReceived, initChannel, initClientChannel, onClientConnected, onClientDisconnected, onConnectionStatusChanged, onDecodeException, onEncodeException, onMessageReceived, removeAllConnectionStatusConsumers, removeAllMessageConsumers, removeConnectionStatusConsumer, removeConnectionStatusConsumer, removeMessageConsumer, scheduleReconnect, sendClientConnectionStatus, sendMessage, sendMessage, sendMessage, start, stop
-
Field Details
-
localAddress
-
-
Constructor Details
-
AbstractTCPServer
-
-
Method Details
-
getSocketAddressString
Description copied from class:AbstractNettyIOServer
Get a string identifier that uniquely identifies the current instance of this server. e.g. tcp://IP:PORT- Specified by:
getSocketAddressString
in classAbstractNettyIOServer<T,
io.netty.channel.socket.SocketChannel, io.netty.bootstrap.ServerBootstrap, InetSocketAddress>
-
createAndConfigureBootstrap
protected io.netty.bootstrap.ServerBootstrap createAndConfigureBootstrap()Description copied from class:AbstractNettyIOServer
Create and configure the bootstrap to use for this instance- Specified by:
createAndConfigureBootstrap
in classAbstractNettyIOServer<T,
io.netty.channel.socket.SocketChannel, io.netty.bootstrap.ServerBootstrap, InetSocketAddress>
-
getClientDescriptor
Description copied from class:AbstractNettyIOServer
Should return a descriptor to identify the specified client for use in log files etc.- Specified by:
getClientDescriptor
in classAbstractNettyIOServer<T,
io.netty.channel.socket.SocketChannel, io.netty.bootstrap.ServerBootstrap, InetSocketAddress>
-