jdk/src/solaris/classes/sun/nio/ch/SinkChannelImpl.java
changeset 22604 9b394795e216
parent 19607 bee007586d06
child 23010 6dadb192ad81
equal deleted inserted replaced
22603:816588059f9d 22604:9b394795e216
   116                                      SelectionKeyImpl sk) {
   116                                      SelectionKeyImpl sk) {
   117         int intOps = sk.nioInterestOps();// Do this just once, it synchronizes
   117         int intOps = sk.nioInterestOps();// Do this just once, it synchronizes
   118         int oldOps = sk.nioReadyOps();
   118         int oldOps = sk.nioReadyOps();
   119         int newOps = initialOps;
   119         int newOps = initialOps;
   120 
   120 
   121         if ((ops & PollArrayWrapper.POLLNVAL) != 0)
   121         if ((ops & Net.POLLNVAL) != 0)
   122             throw new Error("POLLNVAL detected");
   122             throw new Error("POLLNVAL detected");
   123 
   123 
   124         if ((ops & (PollArrayWrapper.POLLERR
   124         if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) {
   125                     | PollArrayWrapper.POLLHUP)) != 0) {
       
   126             newOps = intOps;
   125             newOps = intOps;
   127             sk.nioReadyOps(newOps);
   126             sk.nioReadyOps(newOps);
   128             return (newOps & ~oldOps) != 0;
   127             return (newOps & ~oldOps) != 0;
   129         }
   128         }
   130 
   129 
   131         if (((ops & PollArrayWrapper.POLLOUT) != 0) &&
   130         if (((ops & Net.POLLOUT) != 0) &&
   132             ((intOps & SelectionKey.OP_WRITE) != 0))
   131             ((intOps & SelectionKey.OP_WRITE) != 0))
   133             newOps |= SelectionKey.OP_WRITE;
   132             newOps |= SelectionKey.OP_WRITE;
   134 
   133 
   135         sk.nioReadyOps(newOps);
   134         sk.nioReadyOps(newOps);
   136         return (newOps & ~oldOps) != 0;
   135         return (newOps & ~oldOps) != 0;
   144         return translateReadyOps(ops, 0, sk);
   143         return translateReadyOps(ops, 0, sk);
   145     }
   144     }
   146 
   145 
   147     public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) {
   146     public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) {
   148         if (ops == SelectionKey.OP_WRITE)
   147         if (ops == SelectionKey.OP_WRITE)
   149             ops = PollArrayWrapper.POLLOUT;
   148             ops = Net.POLLOUT;
   150         sk.selector.putEventOps(sk, ops);
   149         sk.selector.putEventOps(sk, ops);
   151     }
   150     }
   152 
   151 
   153     private void ensureOpen() throws IOException {
   152     private void ensureOpen() throws IOException {
   154         if (!isOpen())
   153         if (!isOpen())