Interface INetworkChannel
-
- All Superinterfaces:
java.lang.AutoCloseable,IPacketSender
public interface INetworkChannel extends IPacketSender, java.lang.AutoCloseable
A NetworkChannel instance represents an open connection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetChannelId()Returns the unique channelId.HostAndPortgetClientAddress()Returns the client address from this channelINetworkChannelHandlergetHandler()Returns the networkChannelHandler from this channelIPacketListenerRegistrygetPacketRegistry()Returns the own packet listener registry.HostAndPortgetServerAddress()Returns the server address from this channelbooleanisClientProvidedChannel()Returns that, the channel based of the client site connectionvoidsetHandler(INetworkChannelHandler handler)Sets the channel handler for the channels.-
Methods inherited from interface de.dytanic.cloudnet.driver.network.protocol.IPacketSender
sendPacket, sendPacket
-
-
-
-
Method Detail
-
getChannelId
long getChannelId()
Returns the unique channelId. The Channel Id begins with 1 and ends with Long.MAX_VALUE
-
getServerAddress
HostAndPort getServerAddress()
Returns the server address from this channel
-
getClientAddress
HostAndPort getClientAddress()
Returns the client address from this channel
-
getHandler
INetworkChannelHandler getHandler()
Returns the networkChannelHandler from this channel
-
setHandler
void setHandler(INetworkChannelHandler handler)
Sets the channel handler for the channels. That is important for the handling of receiving packets or channel closing and connect handler- Parameters:
handler- the handler, that should handle this channel
-
getPacketRegistry
IPacketListenerRegistry getPacketRegistry()
Returns the own packet listener registry. The packetRegistry is a sub registry of the network component packet listener registry
-
isClientProvidedChannel
boolean isClientProvidedChannel()
Returns that, the channel based of the client site connection
-
-