author | alanb |
Tue, 29 Jun 2010 17:11:12 +0100 | |
changeset 5983 | b5bc332cd233 |
child 44414 | 06222fd091b4 |
permissions | -rw-r--r-- |
5983
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
1 |
/* |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
2 |
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
4 |
* |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
8 |
* |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
13 |
* accompanied this code). |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
14 |
* |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
18 |
* |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
21 |
* questions. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
22 |
*/ |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
23 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
24 |
/* @test |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
25 |
* @bug 6213702 |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
26 |
* @summary OOB data causes a SocketChannel, with OOBINLINE disabled, to be |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
27 |
* selected |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
28 |
*/ |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
29 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
30 |
import java.net.*; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
31 |
import java.nio.ByteBuffer; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
32 |
import java.nio.channels.*; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
33 |
import java.io.IOException; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
34 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
35 |
public class OutOfBand { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
36 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
37 |
public static void main(String[] args) throws Exception { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
38 |
ServerSocketChannel ssc = null; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
39 |
SocketChannel sc = null; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
40 |
Selector sel = null; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
41 |
Socket s = null; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
42 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
43 |
try { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
44 |
// establish loopback connection. |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
45 |
ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0)); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
46 |
s = new Socket(InetAddress.getLocalHost(), |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
47 |
ssc.socket().getLocalPort()); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
48 |
sc = ssc.accept(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
49 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
50 |
sel = Selector.open(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
51 |
sc.configureBlocking(false); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
52 |
sc.register(sel, SelectionKey.OP_READ); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
53 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
54 |
// OOB data should be disabled by default |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
55 |
if (sc.socket().getOOBInline()) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
56 |
throw new RuntimeException("SO_OOBINLINE enabled"); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
57 |
test(s, false, 0, 0, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
58 |
test(s, false, 512, 0, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
59 |
test(s, false, 0, 512, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
60 |
test(s, false, 512, 512, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
61 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
62 |
// enable SO_OOBINLINE |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
63 |
sc.socket().setOOBInline(true); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
64 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
65 |
// OOB data should be received |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
66 |
test(s, true, 0, 0, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
67 |
test(s, true, 512, 0, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
68 |
test(s, true, 0, 512, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
69 |
test(s, true, 512, 512, sel); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
70 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
71 |
} finally { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
72 |
if (sel != null) sel.close(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
73 |
if (sc != null) sc.close(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
74 |
if (ssc != null) ssc.close(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
75 |
if (s != null) sc.close(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
76 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
77 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
78 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
79 |
static void test(Socket s, boolean urgentExpected, |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
80 |
int bytesBefore, int bytesAfter, |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
81 |
Selector sel) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
82 |
throws IOException |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
83 |
{ |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
84 |
// send data |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
85 |
int bytesExpected = 0; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
86 |
if (bytesBefore > 0) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
87 |
s.getOutputStream().write(new byte[bytesBefore]); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
88 |
bytesExpected += bytesBefore; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
89 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
90 |
s.sendUrgentData(0xff); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
91 |
if (urgentExpected) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
92 |
bytesExpected++; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
93 |
if (bytesAfter > 0) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
94 |
s.getOutputStream().write(new byte[bytesAfter]); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
95 |
bytesExpected += bytesAfter; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
96 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
97 |
|
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
98 |
// receive data, checking for spurious wakeups and reads |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
99 |
int spuriousWakeups = 0; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
100 |
int spuriousReads = 0; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
101 |
int bytesRead = 0; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
102 |
ByteBuffer bb = ByteBuffer.allocate(100); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
103 |
for (;;) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
104 |
int n = sel.select(2000); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
105 |
if (n == 0) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
106 |
if (bytesRead == bytesExpected) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
107 |
System.out.format("Selector wakeups %d\tSpurious reads %d%n", |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
108 |
spuriousWakeups, spuriousReads); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
109 |
return; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
110 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
111 |
if (++spuriousWakeups >= 3) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
112 |
throw new RuntimeException("Selector appears to be spinning" + |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
113 |
" or data not received"); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
114 |
continue; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
115 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
116 |
if (n > 1) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
117 |
throw new RuntimeException("More than one key selected????"); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
118 |
SelectionKey key = sel.selectedKeys().iterator().next(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
119 |
bb.clear(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
120 |
n = ((SocketChannel)key.channel()).read(bb); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
121 |
if (n == 0) { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
122 |
if (++spuriousReads >=3) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
123 |
throw new RuntimeException("Too many spurious reads"); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
124 |
} else { |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
125 |
bytesRead += n; |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
126 |
if (bytesRead > bytesExpected) |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
127 |
throw new RuntimeException("Received more than expected"); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
128 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
129 |
sel.selectedKeys().clear(); |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
130 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
131 |
} |
b5bc332cd233
6213702: (so) non-blocking sockets with TCP urgent disabled get still selected for read ops (win)
alanb
parents:
diff
changeset
|
132 |
} |