Interface INetworkClient

  • All Superinterfaces:
    java.lang.AutoCloseable, IPacketSender
    All Known Implementing Classes:
    NettyNetworkClient

    public interface INetworkClient
    extends java.lang.AutoCloseable
    The network client represents a client based connector to one or more remote servers.
    • Method Detail

      • connect

        boolean connect​(@NotNull
                        @NotNull HostAndPort hostAndPort)
        Open a new connection to the specific host and port
        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
      • getConnectedTime

        long getConnectedTime()
        Gets the time when this client was connected to the server in milliseconds
      • isSslEnabled

        boolean isSslEnabled()
        Returns true if the network component allows to create a ssl connection
      • getChannels

        java.util.Collection<INetworkChannel> getChannels()
        Returns all running enabled connections from the network component
      • getPacketDispatcher

        java.util.concurrent.Executor getPacketDispatcher()
      • closeChannels

        void closeChannels()
        Close all open connections from this network component
      • getPacketRegistry

        IPacketListenerRegistry getPacketRegistry()
        Returns the parent packet registry from all channels, that are this network component provide