Class NettyNetworkClientHandler
java.lang.Object
io.netty5.channel.SimpleChannelInboundHandler<BasePacket>
eu.cloudnetservice.driver.network.netty.NettyNetworkHandler
eu.cloudnetservice.driver.network.netty.client.NettyNetworkClientHandler
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
Constructs a default implementation for a client network handler, delegating most of the calls to the network
client.
- Since:
- 4.0
-
Field Summary
FieldsFields inherited from class eu.cloudnetservice.driver.network.netty.NettyNetworkHandler
channel, eventManager -
Constructor Summary
ConstructorsConstructorDescriptionNettyNetworkClientHandler(@NonNull EventManager eventManager, @NonNull NettyNetworkClient nettyNetworkClient, @NonNull HostAndPort connectedAddress) Constructs a new network client handler instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(@NonNull io.netty5.channel.ChannelHandlerContext ctx) protected @NonNull Collection<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 eu.cloudnetservice.driver.network.netty.NettyNetworkHandler
channelExceptionCaught, channelInactive, channelReadComplete, doHandlePacket, messageReceivedMethods inherited from class io.netty5.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class java.lang.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
-
connectedAddress
-
nettyNetworkClient
-
-
Constructor Details
-
NettyNetworkClientHandler
public NettyNetworkClientHandler(@NonNull @NonNull EventManager eventManager, @NonNull @NonNull NettyNetworkClient nettyNetworkClient, @NonNull @NonNull HostAndPort connectedAddress) Constructs a new network client handler instance.- Parameters:
eventManager- the event manager of the current component.nettyNetworkClient- the client which connected to the endpoint.connectedAddress- the server address to which the client connected.- Throws:
NullPointerException- if either the given event manager, client or connect address is null.
-
-
Method Details
-
channelActive
public void channelActive(@NonNull @NonNull io.netty5.channel.ChannelHandlerContext ctx) throws Exception - Throws:
Exception
-
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.
-