|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.net.NetConnectionHandler<TcpServer,TcpConnection,Socket>
com.kuka.comm.net.TcpConnectionHandler
public class TcpConnectionHandler
This class is responsible for handling incoming connection requests at a TCP server.
Override #acceptConnection(TcpServer, Socket) to decide whether an incoming request is accepted. The default
implementation accepts all requests.
| Constructor Summary | |
|---|---|
TcpConnectionHandler(TcpConnectionConfigurator configurator)
Creates a new TCP connection handler that accepts an unlimited number of connections and uses the given configurator to configure the connection. |
|
TcpConnectionHandler(TcpConnectionConfigurator configurator,
int maxConnections)
Creates a new TCP connection handler that uses the given configurator to configure incoming connections and limits the maximum number of active connections to maxConnections. |
|
| Method Summary | |
|---|---|
protected TcpConnection |
createConnection(TcpServer server,
Socket socket)
Creates a new connection for an incoming connection request. |
| Methods inherited from class com.kuka.comm.net.NetConnectionHandler |
|---|
acceptConnection, getConfigurator, getMaxConnections, handleConnection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TcpConnectionHandler(TcpConnectionConfigurator configurator)
configurator - the configurator used to configure incoming connections, must not be null
public TcpConnectionHandler(TcpConnectionConfigurator configurator,
int maxConnections)
maxConnections.
maxConnections - the maximum number of simultaneous connections, must be greater than 0configurator - the configurator used to configure incoming connections, must not be null| Method Detail |
|---|
protected final TcpConnection createConnection(TcpServer server,
Socket socket)
NetConnectionHandler
createConnection in class NetConnectionHandler<TcpServer,TcpConnection,Socket>server - the server receiving the incoming connection requestsocket - object that can be used to identify the incoming connection request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||