Interface INetworkServer

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

    public interface INetworkServer
    extends java.lang.AutoCloseable
    The network server represents a server that can register and receive INetworkClient connections and packets It is made for a simple read and write network with a client and a server. You can bind this server on more than one addresses
    See Also:
    INetworkClient
    • Method Detail

      • addListener

        boolean addListener​(int port)
        Binds the server to a specific port with the host alias address "0.0.0.0"
        Parameters:
        port - the port, that the server should bind
        Returns:
        true when the binding was successful or false if an error was threw or the port is already bind
      • addListener

        boolean addListener​(@NotNull
                            @NotNull HostAndPort hostAndPort)
        Binds the server to a specific address that is as parameter defined
        Parameters:
        hostAndPort - the address that should the server bind
        Returns:
        true when the binding was successful or false if an error was threw or the port is already bind
      • 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