geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/network/src/java/org/apache/geronimo/network SelectorManager.java
Date Tue, 03 Aug 2004 12:53:10 GMT
adc         2004/08/03 05:53:10

  Modified:    modules/network/src/java/org/apache/geronimo/network
                        SelectorManager.java
  Log:
  Extreme logging.  This will go away once this JVM/NIO issue has settled down.
  
  Revision  Changes    Path
  1.18      +32 -2     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java
  
  Index: SelectorManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SelectorManager.java	2 Aug 2004 23:38:03 -0000	1.17
  +++ SelectorManager.java	3 Aug 2004 12:53:10 -0000	1.18
  @@ -153,6 +153,21 @@
                       if (selector.select(timeout) == 0) {
                           log.trace("timeout == 0");
   
  +                        Iterator list = selector.keys().iterator();
  +                        while (list.hasNext()) {
  +                            SelectionKey key = (SelectionKey) list.next();
  +                            log.trace("Still watching " + key + " key is "
  +                                      + ((key.interestOps() & SelectionKey.OP_READ)
!= 0 ? "RF " : "")
  +                                      + ((key.interestOps() & SelectionKey.OP_WRITE)
!= 0 ? "WF " : "")
  +                                      + ((key.interestOps() & SelectionKey.OP_ACCEPT)
!= 0 ? "AF " : "")
  +                                      + (key.isValid() ? "V " : "IV ")
  +                                      + (key.isReadable() ? "RD " : "IRD ")
  +                                      + (key.isWritable() ? "WR " : "IWR ")
  +                                      + (key.isAcceptable() ? "AC " : "IAC ")
  +                                      + (key.isConnectable() ? "CN " : "ICN ")
  +                            );
  +                        }
  +
                           /**
                            * Clean stale connections that do not have and data: select
                            * returns indicating that the count of active connections with
  @@ -162,7 +177,7 @@
                            *
                            * http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=DIR-18
                            */
  -                        Iterator list = selector.selectedKeys().iterator();
  +                        list = selector.selectedKeys().iterator();
   
                           while (list.hasNext()) {
                               SelectionKey key = (SelectionKey) list.next();
  @@ -173,6 +188,21 @@
                           }
   
                           continue;
  +                    }
  +
  +                    Iterator list = selector.keys().iterator();
  +                    while (list.hasNext()) {
  +                        SelectionKey key = (SelectionKey) list.next();
  +                        log.trace("Still watching " + key + " key is "
  +                                  + ((key.interestOps() & SelectionKey.OP_READ) !=
0 ? "RF " : "")
  +                                  + ((key.interestOps() & SelectionKey.OP_WRITE) !=
0 ? "WF " : "")
  +                                  + ((key.interestOps() & SelectionKey.OP_ACCEPT) !=
0 ? "AF " : "")
  +                                  + (key.isValid() ? "V " : "IV ")
  +                                  + (key.isReadable() ? "RD " : "IRD ")
  +                                  + (key.isWritable() ? "WR " : "IWR ")
  +                                  + (key.isAcceptable() ? "AC " : "IAC ")
  +                                  + (key.isConnectable() ? "CN " : "ICN ")
  +                        );
                       }
   
                       // Get a java.util.Set containing the SelectionKey objects for
  
  
  

Mime
View raw message