Class DefaultNetworkChannel

    • Method Detail

      • sendPacket

        public void sendPacket​(@NotNull
                               @NotNull IPacket... packets)
        Description copied from interface: IPacketSender
        Transport packet instances into the network to the receiver. The receiver will handle the packets if he knows the channel and has listeners for the channel

        A packet are doesn't allow to be null All elements should be checked that be not null and send after that

        Specified by:
        sendPacket in interface IPacketSender
        Parameters:
        packets - the packets, which should transport into the network
      • sendChunkedPackets

        public boolean sendChunkedPackets​(@NotNull
                                          @NotNull 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
        Specified by:
        sendChunkedPackets in interface INetworkChannel
        Throws:
        java.io.IOException
      • sendChunkedPacketsResponse

        public 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
        Specified by:
        sendChunkedPacketsResponse in interface INetworkChannel
        Throws:
        java.io.IOException
      • sendChunkedPackets

        public boolean sendChunkedPackets​(@NotNull
                                          @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument header,
                                          @NotNull
                                          @NotNull java.io.InputStream inputStream,
                                          int channel)
                                   throws java.io.IOException
        Specified by:
        sendChunkedPackets in interface INetworkChannel
        Throws:
        java.io.IOException
      • getChannelId

        public long getChannelId()
        Description copied from interface: INetworkChannel
        Returns the unique channelId. The Channel Id begins with 1 and ends with Long.MAX_VALUE
        Specified by:
        getChannelId in interface INetworkChannel
      • setHandler

        public void setHandler​(INetworkChannelHandler handler)
        Description copied from interface: INetworkChannel
        Sets the channel handler for the channels. That is important for the handling of receiving packets or channel closing and connect handler
        Specified by:
        setHandler in interface INetworkChannel
        Parameters:
        handler - the handler, that should handle this channel