Interface INetworkChannel
-
- All Superinterfaces:
java.lang.AutoCloseable,IPacketSender
- All Known Implementing Classes:
DefaultNetworkChannel,NettyNetworkChannel
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 channelbooleanisActive()booleanisClientProvidedChannel()Returns that, the channel based of the client site connectionbooleanisWriteable()de.dytanic.cloudnet.common.concurrent.ITask<IPacket>registerQueryResponseHandler(java.util.UUID uniqueId)de.dytanic.cloudnet.common.concurrent.ITask<ChunkedQueryResponse>sendChunkedPacketQuery(@NotNull IPacket packet)booleansendChunkedPackets(@NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull java.io.InputStream inputStream, int channel)booleansendChunkedPackets(java.util.UUID uniqueId, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull java.io.InputStream inputStream, int channel)booleansendChunkedPacketsResponse(@NotNull java.util.UUID uniqueId, @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull java.io.InputStream inputStream)IPacketsendQuery(@NotNull IPacket packet)de.dytanic.cloudnet.common.concurrent.ITask<IPacket>sendQueryAsync(@NotNull IPacket packet)voidsetHandler(INetworkChannelHandler handler)Sets the channel handler for the channels.-
Methods inherited from interface de.dytanic.cloudnet.driver.network.protocol.IPacketSender
sendPacket, sendPacket, sendPacketSync, sendPacketSync
-
-
-
-
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
-
sendQueryAsync
de.dytanic.cloudnet.common.concurrent.ITask<IPacket> sendQueryAsync(@NotNull @NotNull IPacket packet)
-
registerQueryResponseHandler
de.dytanic.cloudnet.common.concurrent.ITask<IPacket> registerQueryResponseHandler(java.util.UUID uniqueId)
-
sendChunkedPacketQuery
de.dytanic.cloudnet.common.concurrent.ITask<ChunkedQueryResponse> sendChunkedPacketQuery(@NotNull @NotNull IPacket packet)
-
sendChunkedPacketsResponse
boolean sendChunkedPacketsResponse(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull @NotNull java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
sendChunkedPackets
boolean sendChunkedPackets(@NotNull @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull @NotNull java.io.InputStream inputStream, int channel) throws java.io.IOException- Throws:
java.io.IOException
-
sendChunkedPackets
boolean sendChunkedPackets(java.util.UUID uniqueId, @NotNull @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header, @NotNull @NotNull java.io.InputStream inputStream, int channel) throws java.io.IOException- Throws:
java.io.IOException
-
isWriteable
boolean isWriteable()
-
isActive
boolean isActive()
-
-