~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to gnu/java/nio/SelectorImpl.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
import java.nio.channels.SelectableChannel;
44
44
import java.nio.channels.SelectionKey;
45
45
import java.nio.channels.Selector;
 
46
import java.nio.channels.SocketChannel;
46
47
import java.nio.channels.spi.AbstractSelectableChannel;
47
48
import java.nio.channels.spi.AbstractSelector;
48
49
import java.nio.channels.spi.SelectorProvider;
284
285
                // Set new ready write ops
285
286
                for (int i = 0; i < write.length; i++)
286
287
                  {
287
 
                    if (key.getNativeFD() == write[i])
288
 
                      {
289
 
                        ops = ops | SelectionKey.OP_WRITE;
290
 
 
291
 
        //                 if (key.channel ().isConnected ())
292
 
        //                   {
293
 
        //                     ops = ops | SelectionKey.OP_WRITE;
294
 
        //                   }
295
 
        //                 else
296
 
        //                   {
297
 
        //                     ops = ops | SelectionKey.OP_CONNECT;
298
 
        //                   }
299
 
                     }
 
288
                    if (key.getNativeFD() == write[i])
 
289
                      {
 
290
                        if (key.channel() instanceof SocketChannel)
 
291
                          {
 
292
                            if (((SocketChannel) key.channel ()).isConnected ())
 
293
                              ops = ops | SelectionKey.OP_WRITE;
 
294
                            else
 
295
                              ops = ops | SelectionKey.OP_CONNECT;
 
296
                          }
 
297
                        else
 
298
                          ops = ops | SelectionKey.OP_WRITE;
 
299
                      }
300
300
                  }
301
301
 
302
302
                // FIXME: We dont handle exceptional file descriptors yet.