public class UdpNetworkManager extends Object implements NetworkManager
| Modifier and Type | Field and Description |
|---|---|
static int |
N_THREADS |
static long |
SHUTDOWN_TIME |
| Constructor and Description |
|---|
UdpNetworkManager()
Creates a new Network Manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activates the manager.
|
io.netty.channel.ChannelFuture |
bindDatagramChannel(String address,
int port,
io.netty.channel.ChannelHandler handler)
Binds a channel to the default address and a random port.
|
void |
deactivate()
Deactivates the manager.
|
boolean |
isActive()
Gets whether the manager is active.
|
public static final int N_THREADS
public static final long SHUTDOWN_TIME
public UdpNetworkManager()
address - The address the manager will bind channels to.portManager - The port range manager.public io.netty.channel.ChannelFuture bindDatagramChannel(String address, int port, io.netty.channel.ChannelHandler handler) throws IllegalStateException
NetworkManagerbindDatagramChannel in interface NetworkManagerhandler - The channel handler.IllegalStateException - If the manager is inactive.public void activate()
throws IllegalStateException
NetworkManagerOnce activated, the manager will allocate an internal scheduler to handle IO operations and will be able to provide channels.
activate in interface NetworkManagerIllegalStateException - If the manager was already activatedpublic void deactivate()
throws IllegalStateException
NetworkManagerThe internal scheduler will elegantly shutdown any active channel and the manager won't be able to provide channels.
deactivate in interface NetworkManagerIllegalStateException - If the manager is inactive.public boolean isActive()
NetworkManagerisActive in interface NetworkManagertrue if the manager is active; false otherwise.Copyright © 2017 TeleStax, Inc.. All Rights Reserved.