org/sonews/daemon/Connections.java
changeset 3 2fdc9cc89502
parent 1 6fceb66e1ad7
child 15 f2293e8566f5
     1.1 --- a/org/sonews/daemon/Connections.java	Fri Jun 26 16:48:50 2009 +0200
     1.2 +++ b/org/sonews/daemon/Connections.java	Wed Jul 22 14:04:05 2009 +0200
     1.3 @@ -18,6 +18,7 @@
     1.4  
     1.5  package org.sonews.daemon;
     1.6  
     1.7 +import org.sonews.config.Config;
     1.8  import org.sonews.util.Log;
     1.9  import java.io.IOException;
    1.10  import java.net.InetSocketAddress;
    1.11 @@ -37,7 +38,7 @@
    1.12   * @author Christian Lins
    1.13   * @since sonews/0.5.0
    1.14   */
    1.15 -final class Connections extends AbstractDaemon
    1.16 +public final class Connections extends AbstractDaemon
    1.17  {
    1.18  
    1.19    private static final Connections instance = new Connections();
    1.20 @@ -70,7 +71,7 @@
    1.21      synchronized(this.connections)
    1.22      {
    1.23        this.connections.add(conn);
    1.24 -      this.connByChannel.put(conn.getChannel(), conn);
    1.25 +      this.connByChannel.put(conn.getSocketChannel(), conn);
    1.26      }
    1.27    }
    1.28    
    1.29 @@ -95,9 +96,9 @@
    1.30        for(NNTPConnection conn : this.connections)
    1.31        {
    1.32          assert conn != null;
    1.33 -        assert conn.getChannel() != null;
    1.34 +        assert conn.getSocketChannel() != null;
    1.35  
    1.36 -        Socket socket = conn.getChannel().socket();
    1.37 +        Socket socket = conn.getSocketChannel().socket();
    1.38          if(socket != null)
    1.39          {
    1.40            InetSocketAddress sockAddr = (InetSocketAddress)socket.getRemoteSocketAddress();
    1.41 @@ -123,7 +124,7 @@
    1.42    {
    1.43      while(isRunning())
    1.44      {
    1.45 -      int timeoutMillis = 1000 * Config.getInstance().get(Config.TIMEOUT, 180);
    1.46 +      int timeoutMillis = 1000 * Config.inst().get(Config.TIMEOUT, 180);
    1.47        
    1.48        synchronized (this.connections)
    1.49        {
    1.50 @@ -139,7 +140,7 @@
    1.51              iter.remove();
    1.52  
    1.53              // Close and remove the channel
    1.54 -            SocketChannel channel = conn.getChannel();
    1.55 +            SocketChannel channel = conn.getSocketChannel();
    1.56              connByChannel.remove(channel);
    1.57              
    1.58              try