Interface INetworkServer

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

    public interface INetworkServer
    extends INetworkComponent, 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​(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