/[classpath]/classpath/gnu/java/nio/SelectorImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/SelectorImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by rveldema, Mon Mar 11 16:24:12 2002 UTC revision 1.2 by rveldema, Tue Mar 12 11:36:22 2002 UTC
# Line 1  Line 1 
1  package manta.runtime;  package gnu.java.nio;
2    
3  import java.util.*;  import java.util.*;
4  import java.nio.channels.*;  import java.nio.channels.*;
# Line 9  public class SelectorImpl extends Abstra Line 9  public class SelectorImpl extends Abstra
9  {  {
10      Set keys, selected, canceled;      Set keys, selected, canceled;
11    
12      SelectorImpl(SelectorProvider provider)      public SelectorImpl(SelectorProvider provider)
13      {      {
14          super(provider);          super(provider);
15      }      }
16    
17      Set keys()      public Set keys()
18      {      {
19          return keys;          return keys;
20      }      }
21            
22      int selectNow()    { return select(1);                }      public int selectNow()    { return select(1);                }
23      int select()       { return select(Long.MAX_VALUE);   }      public int select()       { return select(Long.MAX_VALUE);   }
24    
25      private static MantaNative int java_do_select(int []read,      private static native int java_do_select(int []read,
26                                                    int []write,                                               int []write,
27                                                    int []except,                                               int []except,
28                                                    long timeout);                                               long timeout);
29    
30      int select(long  timeout)      public int select(long  timeout)
31      {      {
32          if (keys == null)          if (keys == null)
33              {              {
# Line 72  public class SelectorImpl extends Abstra Line 72  public class SelectorImpl extends Abstra
72          return ret;          return ret;
73      }      }
74            
   
     Set selectedKeys()    {     return selected;    }  
     Set cancelledKeys()   {     return canceled;    }  
   
   
75            
76      Selector wakeup()      public Set selectedKeys()    {      return selected;    }
77        public Set cancelledKeys()   {      return canceled;    }
78    
79        public Selector wakeup()
80      {      {
81          return null;          return null;
82      }      }
83    
84      void add(SelectionKeyImpl k)      public void add(SelectionKeyImpl k)
85      {      {
86          if (keys == null)          if (keys == null)
87              keys = new HashSet();              keys = new HashSet();
88    
89          keys.add(k);          keys.add(k);
90      }      }
91    
92      void add_selected(SelectionKeyImpl k)      void add_selected(SelectionKeyImpl k)
93      {      {
94          if (selected == null)          if (selected == null)
# Line 118  public class SelectorImpl extends Abstra Line 117  public class SelectorImpl extends Abstra
117      {      {
118          /*          /*
119            // filechannel is not selectable ?            // filechannel is not selectable ?
120          if (ch instanceof manta.runtime.FileChannelImpl)          if (ch instanceof gnu.java.nio.FileChannelImpl)
121              {              {
122                  FileChannelImpl fc = (FileChannelImpl) ch;                  FileChannelImpl fc = (FileChannelImpl) ch;
123    
# Line 133  public class SelectorImpl extends Abstra Line 132  public class SelectorImpl extends Abstra
132          else          else
133          */          */
134                    
135          if (ch instanceof manta.runtime.SocketChannelImpl)          if (ch instanceof gnu.java.nio.SocketChannelImpl)
136              {              {
137                  SocketChannelImpl fc = (SocketChannelImpl) ch;                  SocketChannelImpl fc = (SocketChannelImpl) ch;
138    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26