Class NettyNetworkServerHandler
java.lang.Object
io.netty5.channel.SimpleChannelInboundHandler<eu.cloudnetservice.driver.network.protocol.BasePacket>
eu.cloudnetservice.driver.impl.network.netty.NettyNetworkHandler
eu.cloudnetservice.driver.impl.network.netty.server.NettyNetworkServerHandler
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
The default netty based implementation of the netty network handler responsible to provide basic access to the
network server handling.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NettyNetworkServerprivate final eu.cloudnetservice.driver.network.HostAndPortFields inherited from class NettyNetworkHandler
channel -
Constructor Summary
ConstructorsConstructorDescriptionNettyNetworkServerHandler(@NonNull NettyNetworkServer networkServer, @NonNull eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress) Constructs a new network server handler instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(@NonNull io.netty5.channel.ChannelHandlerContext ctx) protected @NonNull Collection<eu.cloudnetservice.driver.network.NetworkChannel> channels()Get all channels which are connected to the underlying network component.Get the packet dispatcher used to dispatch incoming packets.Methods inherited from class NettyNetworkHandler
channelExceptionCaught, channelInactive, channelReadComplete, doHandlePacket, messageReceivedMethods inherited from class io.netty5.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty5.channel.ChannelHandler
bind, channelInboundEvent, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, isSharable, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
Field Details
-
serverLocalAddress
private final eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress -
networkServer
-
-
Constructor Details
-
NettyNetworkServerHandler
public NettyNetworkServerHandler(@NonNull @NonNull NettyNetworkServer networkServer, @NonNull @NonNull eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress) Constructs a new network server handler instance.- Parameters:
networkServer- the network server associated with this handler.serverLocalAddress- the server address this handler is associated with.- Throws:
NullPointerException- if either the given event manager, server or address is null.
-
-
Method Details
-
channelActive
-
channels
Get all channels which are connected to the underlying network component.- Specified by:
channelsin classNettyNetworkHandler- Returns:
- all connected channels.
-
packetDispatcher
Get the packet dispatcher used to dispatch incoming packets. Each dispatcher is normally bound to the network component which opened/received the connection and requested this handler.- Specified by:
packetDispatcherin classNettyNetworkHandler- Returns:
- the dispatcher used to dispatch packets.
-