Class TcpHandler
java.lang.Object
org.opendaylight.openflowjava.protocol.impl.core.TcpHandler
- All Implemented Interfaces:
Runnable,OnlineProvider,ServerFacade,ShutdownProvider
Class implementing server over TCP / TLS for handling incoming connections.
- Author:
- michal.polkorab
-
Constructor Summary
ConstructorsConstructorDescriptionTcpHandler(int port, Runnable readyRunnable) Constructor of TCPHandler that listens on selected port.TcpHandler(InetAddress address, int port, Runnable readyRunnable) Constructor of TCPHandler that listens on selected address and port. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<Boolean>intReturns the number of connected clients / channels.intgetPort()io.netty.channel.EventLoopGroupprotected voidinitiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) Initiate Epoll event loop groups with Nio as fall back.voidinitiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) Initiate event loop groups.voidinitiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) Initiate Nio event loop groups.voidrun()Starts server on selected port.voidsetChannelInitializer(TcpChannelInitializer channelInitializer) voidsetThreadConfig(ThreadConfiguration threadConfig) Deprecated, for removal: This API element is subject to removal in a future version.com.google.common.util.concurrent.ListenableFuture<Boolean>shutdown()Shuts downTcpHandler}.
-
Constructor Details
-
TcpHandler
Constructor of TCPHandler that listens on selected port.- Parameters:
port- listening port of TCPHandler server
-
TcpHandler
Constructor of TCPHandler that listens on selected address and port.- Parameters:
address- listening address of TCPHandler serverport- listening port of TCPHandler server
-
-
Method Details
-
run
public void run()Starts server on selected port. -
shutdown
Shuts downTcpHandler}.- Specified by:
shutdownin interfaceShutdownProvider
-
getNumberOfConnections
public int getNumberOfConnections()Returns the number of connected clients / channels.- Returns:
- number of connected clients / channels
-
getIsOnlineFuture
- Specified by:
getIsOnlineFuturein interfaceOnlineProvider
-
getPort
public int getPort() -
getAddress
-
setChannelInitializer
-
setThreadConfig
@Deprecated(since="0.17.2", forRemoval=true) public void setThreadConfig(ThreadConfiguration threadConfig) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ServerFacadeSets thread configuration.- Specified by:
setThreadConfigin interfaceServerFacade- Parameters:
threadConfig- desired thread configuration
-
initiateEventLoopGroups
public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) Initiate event loop groups.- Parameters:
threadConfiguration- number of threads to be created, if not specified in threadConfig
-
initiateNioEventLoopGroups
Initiate Nio event loop groups.- Parameters:
threadConfiguration- number of threads to be created, if not specified in threadConfig
-
initiateEpollEventLoopGroups
Initiate Epoll event loop groups with Nio as fall back.- Parameters:
threadConfiguration- the ThreadConfiguration
-
getWorkerGroup
public io.netty.channel.EventLoopGroup getWorkerGroup()
-