/[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.6 by mkoch, Mon Nov 18 11:26:03 2002 UTC revision 1.7 by mkoch, Wed Jun 18 09:45:00 2003 UTC
# Line 170  public class SelectorImpl extends Abstra Line 170  public class SelectorImpl extends Abstra
170    protected SelectionKey register (AbstractSelectableChannel ch, int ops,    protected SelectionKey register (AbstractSelectableChannel ch, int ops,
171                                     Object att)                                     Object att)
172    {    {
173      /*      SelectionKeyImpl result;
174            // filechannel is not selectable ?      
     if (ch instanceof FileChannelImpl)  
       {  
         FileChannelImpl fc = (FileChannelImpl) ch;  
         SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, fc.fd);  
         keys.add (impl);  
         return impl;  
       }  
     else  
     */  
           
175      if (ch instanceof SocketChannelImpl)      if (ch instanceof SocketChannelImpl)
176              {        {
177          SocketChannelImpl sc = (SocketChannelImpl) ch;          SocketChannelImpl sc = (SocketChannelImpl) ch;
178          SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, sc.fd);          result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
179          add (impl);        }
180          return impl;      else if (ch instanceof DatagramChannelImpl)
181              }        {
182            DatagramChannelImpl dc = (DatagramChannelImpl) ch;
183            result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
184          }
185      else if (ch instanceof ServerSocketChannelImpl)      else if (ch instanceof ServerSocketChannelImpl)
186        {        {
187          ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;          ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
188          SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, ssc.fd);          result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
         add (impl);  
         return impl;  
189        }        }
190      else      else
191              {        {
192          System.err.println ("INTERNAL ERROR, no known channel type");          throw new InternalError ("No known channel type");
193              }        }
194    
195      return null;      add (result);
196        result.interestOps (ops);
197        result.attach (att);
198        return result;
199    }    }
200  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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