Class Connections

java.lang.Object
org.sonews.daemon.DaemonRunner
org.sonews.daemon.Connections
All Implemented Interfaces:
Runnable, DaemonRunnable

public final class Connections extends DaemonRunner
Daemon thread collecting all NNTPConnection instances. The thread checks periodically if there are stale/timed out connections and removes and purges them properly.
Since:
sonews/0.5.0
Author:
Christian Lins
  • Method Details

    • getInstance

      public static Connections getInstance()
      Returns:
      Active Connections instance.
    • add

      public void add(NNTPConnection conn)
      Adds the given NNTPConnection to the Connections management.
      Parameters:
      conn -
      See Also:
      • invalid reference
        org.sonews.daemon.SynchronousNNTPConnection
    • get

      public NNTPConnection get(SocketChannel channel)
      Parameters:
      channel -
      Returns:
      NNTPConnection instance that is associated with the given SocketChannel.
    • run

      public void run()
      Run loops. Checks periodically for timed out connections and purged them from the lists.