Class NetServer<S extends NetSession,​D>

    • Method Detail

      • createSession

        public abstract S createSession​(NetPackage netPackage)
        This method must implements the session creation based on the net package that incoming.
        Parameters:
        netPackage - Net package.
        Returns:
        Return the session based on the package.
      • isMultiSession

        public final boolean isMultiSession()
        This method return a flag to indicate if the server is multisession or not
        Returns:
        Return true if the server is multisession and false otherwise
      • isDisconnectAndRemove

        public final boolean isDisconnectAndRemove()
        This method indicate if the server must destroy de session when the session is disconnected.
        Returns:
        True to destroy and false otherwise
      • start

        public final void start()
        This method starts the server.
      • onStart

        protected void onStart()
        This method should be overwritten to know when the server is started
      • stop

        public final void stop()
        This method stops the server.
      • onStop

        protected void onStop()
        This method should be overwritten to know when the server is stopped
      • isCreationTimeoutAvailable

        public boolean isCreationTimeoutAvailable()
        Verify if the specific implementation of net server need to start a connection timeout.
        Returns:
        Connection timeout available.