Interface DefaultNetworkComponent
- All Superinterfaces:
NetworkComponent,PacketSender
- All Known Implementing Classes:
NettyNetworkClient,NettyNetworkServer
A delegate default interface for a network component implementation.
- Since:
- 4.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCloses all open connections associated with this network component.Get the collection of channels which are connected to this network component.default voidsendPacket(@NonNull Packet packet) Sends the given packet to the associated target.default voidsendPacket(@NonNull Packet... packets) Sends all the given packets to the associated target.default voidsendPacketSync(@NonNull Packet packet) Sends the given packet to the associated target, waiting for the packet write to the channel to complete before resuming the current thread.Methods inherited from interface eu.cloudnetservice.driver.network.NetworkComponent
channels, firstChannel, packetDispatcher, packetRegistry, sslEnabledMethods inherited from interface eu.cloudnetservice.driver.network.protocol.PacketSender
sendPacketSync
-
Field Details
-
LOGGER
static final eu.cloudnetservice.common.log.Logger LOGGER
-
-
Method Details
-
modifiableChannels
Get the collection of channels which are connected to this network component. The returned collection is modifiable, but should not be used by developers to make any changes to it. If you need all channels which are connected to the component useNetworkComponent.channels()instead.- Returns:
- all channels which are connected to this component, modifiable.
-
closeChannels
default void closeChannels()Closes all open connections associated with this network component.- Specified by:
closeChannelsin interfaceNetworkComponent
-
sendPacket
Sends the given packet to the associated target.- Specified by:
sendPacketin interfacePacketSender- Parameters:
packet- the packet to send.
-
sendPacketSync
Sends the given packet to the associated target, waiting for the packet write to the channel to complete before resuming the current thread.- Specified by:
sendPacketSyncin interfacePacketSender- Parameters:
packet- the packet to send.
-
sendPacket
Sends all the given packets to the associated target.- Specified by:
sendPacketin interfacePacketSender- Parameters:
packets- the packets to send.
-