public class TcpHandler extends Object implements ServerFacade
Constructor and Description |
---|
TcpHandler(InetAddress address,
int port,
Runnable readyRunnable)
Constructor of TCPHandler that listens on selected address and port.
|
TcpHandler(int port,
Runnable readyRunnable)
Constructor of TCPHandler that listens on selected port.
|
Modifier and Type | Method and Description |
---|---|
String |
getAddress() |
com.google.common.util.concurrent.ListenableFuture<Boolean> |
getIsOnlineFuture() |
int |
getNumberOfConnections()
Returns the number of connected clients / channels.
|
int |
getPort() |
io.netty.channel.EventLoopGroup |
getWorkerGroup() |
protected void |
initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration)
Initiate Epoll event loop groups with Nio as fall back.
|
void |
initiateEventLoopGroups(ThreadConfiguration threadConfiguration,
boolean isEpollEnabled)
Initiate event loop groups.
|
void |
initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration)
Initiate Nio event loop groups.
|
void |
run()
Starts server on selected port.
|
void |
setChannelInitializer(TcpChannelInitializer channelInitializer) |
void |
setThreadConfig(ThreadConfiguration threadConfig)
Sets thread configuration.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
shutdown()
Shuts down
TcpHandler }. |
public TcpHandler(int port, Runnable readyRunnable)
port
- listening port of TCPHandler serverpublic TcpHandler(InetAddress address, int port, Runnable readyRunnable)
address
- listening address of TCPHandler serverport
- listening port of TCPHandler serverpublic com.google.common.util.concurrent.ListenableFuture<Boolean> shutdown()
TcpHandler
}.shutdown
in interface ShutdownProvider
public int getNumberOfConnections()
public com.google.common.util.concurrent.ListenableFuture<Boolean> getIsOnlineFuture()
getIsOnlineFuture
in interface OnlineProvider
public int getPort()
public String getAddress()
public void setChannelInitializer(TcpChannelInitializer channelInitializer)
public void setThreadConfig(ThreadConfiguration threadConfig)
ServerFacade
setThreadConfig
in interface ServerFacade
threadConfig
- desired thread configurationpublic void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled)
threadConfiguration
- number of threads to be created, if not specified in threadConfigpublic void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration)
threadConfiguration
- number of threads to be created, if not specified in threadConfigprotected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration)
threadConfiguration
- the ThreadConfigurationpublic io.netty.channel.EventLoopGroup getWorkerGroup()
Copyright © 2020 OpenDaylight. All rights reserved.