com.kuka.comm.net
Class TcpConnectionConfigurator

java.lang.Object
  extended by com.kuka.comm.ConnectionConfigurator<C>
      extended by com.kuka.comm.net.NetConnectionConfigurator<TcpConnection>
          extended by com.kuka.comm.net.TcpConnectionConfigurator

public class TcpConnectionConfigurator
extends NetConnectionConfigurator<TcpConnection>

A TcpConnConfigurator is used by a TcpServer to configure a TcpConnection upon an incoming connection request.


Constructor Summary
TcpConnectionConfigurator(Encoder<Object,ByteBuffer> encoder, Decoder<ByteBuffer,Object> decoder)
          Creates a new configurator that uses the given encoder and decoder on configured connections.
 
Method Summary
 void configure(TcpConnection connection)
          Method to setup a TcpConnection with predefined settings.
 void setTcpTimeout(int timeout)
          Sets a timeout for new TcpConnections during construction.
 
Methods inherited from class com.kuka.comm.net.NetConnectionConfigurator
getAutoReconnectStrategy, getDecoder, getEncoder, getInputBufferSize, getOutputBufferSize, isAutoReconnectStrategySet, isInputBufferSizeSet, isOutputBufferSizeSet, setAutoReconnectStrategy, setInputBufferSize, setOutputBufferSize, unsetAutoReconnectStrategy, unsetInputBufferSize, unsetOutputBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpConnectionConfigurator

public TcpConnectionConfigurator(Encoder<Object,ByteBuffer> encoder,
                                 Decoder<ByteBuffer,Object> decoder)
Creates a new configurator that uses the given encoder and decoder on configured connections. The encoder and decoder cannot both be null.

Parameters:
encoder - An encoder.
decoder - A decoder.
Method Detail

configure

public void configure(TcpConnection connection)
Method to setup a TcpConnection with predefined settings.

Overrides:
configure in class NetConnectionConfigurator<TcpConnection>
Parameters:
connection - The TcpConnection to configure.

setTcpTimeout

public final void setTcpTimeout(int timeout)
Sets a timeout for new TcpConnections during construction. The timeout must be greater than 0. A timeout of 0 is interpreted as an infinite timeout.

Parameters:
timeout - the timeout in milliseconds
Throws:
IllegalArgumentException - if the timeout is less than 0


Copyright © 2019. All rights reserved.