Class NettyNetworkClient

    • Field Detail

      • packetDispatcher

        protected final java.util.concurrent.Executor packetDispatcher
      • eventLoopGroup

        protected final io.netty.channel.EventLoopGroup eventLoopGroup
      • networkChannelHandler

        protected final java.util.concurrent.Callable<INetworkChannelHandler> networkChannelHandler
      • connectedTime

        protected long connectedTime
      • sslContext

        protected io.netty.handler.ssl.SslContext sslContext
    • Constructor Detail

      • NettyNetworkClient

        public NettyNetworkClient​(java.util.concurrent.Callable<INetworkChannelHandler> networkChannelHandler)
      • NettyNetworkClient

        @Deprecated
        @ScheduledForRemoval
        public NettyNetworkClient​(java.util.concurrent.Callable<INetworkChannelHandler> networkChannelHandler,
                                  SSLConfiguration sslConfiguration,
                                  de.dytanic.cloudnet.common.concurrent.ITaskScheduler taskScheduler)
        Deprecated.
    • Method Detail

      • isSslEnabled

        public boolean isSslEnabled()
      • connect

        public boolean connect​(@NotNull
                               @NotNull HostAndPort hostAndPort)
        Description copied from interface: INetworkClient
        Open a new connection to the specific host and port
        Specified by:
        connect in interface INetworkClient
        Parameters:
        hostAndPort - the address, that should the client connect to
        Returns:
        true if the connection was success or false if the connection was unsuccessful or refused
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getPacketDispatcher

        public java.util.concurrent.Executor getPacketDispatcher()
      • getConnectedTime

        public long getConnectedTime()
        Description copied from interface: INetworkClient
        Gets the time when this client was connected to the server in milliseconds
        Specified by:
        getConnectedTime in interface INetworkClient