Why is this necessary? If selectedKeys is screwed, we can just iterate
keys() instead - there are only four of them...


On Sun, Jul 27, 2003 at 06:54:15PM -0700, Pascal wrote:
> Update of /cvsroot/freenet/freenet/src/freenet/transport
> In directory sc8-pr-cvs1:/tmp/cvs-serv3582
> 
> Modified Files:
>       ListenSelectorLoop.java 
> Log Message:
> I figured out why my transport level connectivity is so poor, now lets see if this 
> bug affects other people as well.
> 
> Index: ListenSelectorLoop.java
> ===================================================================
> RCS file: /cvsroot/freenet/freenet/src/freenet/transport/ListenSelectorLoop.java,v
> retrieving revision 1.14
> retrieving revision 1.15
> diff -u -r1.14 -r1.15
> --- ListenSelectorLoop.java   28 Jul 2003 01:51:58 -0000      1.14
> +++ ListenSelectorLoop.java   28 Jul 2003 01:54:12 -0000      1.15
> @@ -11,10 +11,11 @@
>  import freenet.NIOListener;
>  
>  /**
> -* this selector registers ServerSocketChannels, the interfaces
> -* listen on it.
> -*/
> -public final class ListenSelectorLoop extends AbstractSelectorLoop {
> + * this selector registers ServerSocketChannels, the interfaces
> + * listen on it.
> + */
> +public final class ListenSelectorLoop extends AbstractSelectorLoop
> +                           implements freenet.support.Checkpointed {
>  
>      //again, this is arbitrary.
>      private static final int MAX_NEW_CONNECTIONS = 20;
> @@ -133,4 +134,22 @@
>  
>      //TODO: need to decide what happens when we close the selector this way.
>      public final void close(){}
> +
> +    private int size;
> +
> +    public void checkpoint() {
> +        int s = sel.keys().size();
> +        if(size > s)
> +            freenet.Core.logger.log(this, "Lost " + (size - s) + " key(s) from the 
> listen selector.  You might as well restart your node, it's really screwed now.  
> Please report JVM & OS version to [EMAIL PROTECTED]", freenet.support.Logger.ERROR);
> +        size = s;
> +    }
> +
> +    public String getCheckpointName() {
> +        return "Listen selector key monitor";
> +    }
> +
> +    public long nextCheckpoint() {
> +        return System.currentTimeMillis() + 60000;
> +    }
> +
>  }
> 
> _______________________________________________
> cvs mailing list
> [EMAIL PROTECTED]
> http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/cvs

-- 
Matthew J Toseland - [EMAIL PROTECTED]
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to