Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ce6b0326
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ce6b0326
编写于
7月 27, 2009
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6863667: (ch) Several tests in java/nio/channels/* need to be updated after 6638712
Reviewed-by: mcimadamore
上级
a4ff16cd
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
45 addition
and
45 deletion
+45
-45
test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
...ava/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
+4
-4
test/java/nio/channels/AsynchronousChannelGroup/Identity.java
.../java/nio/channels/AsynchronousChannelGroup/Identity.java
+4
-4
test/java/nio/channels/AsynchronousChannelGroup/Restart.java
test/java/nio/channels/AsynchronousChannelGroup/Restart.java
+1
-1
test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
...java/nio/channels/AsynchronousChannelGroup/Unbounded.java
+2
-2
test/java/nio/channels/AsynchronousDatagramChannel/Basic.java
.../java/nio/channels/AsynchronousDatagramChannel/Basic.java
+11
-11
test/java/nio/channels/AsynchronousFileChannel/Basic.java
test/java/nio/channels/AsynchronousFileChannel/Basic.java
+4
-4
test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java
...a/nio/channels/AsynchronousServerSocketChannel/Basic.java
+1
-1
test/java/nio/channels/AsynchronousSocketChannel/Basic.java
test/java/nio/channels/AsynchronousSocketChannel/Basic.java
+14
-14
test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java
...io/channels/AsynchronousSocketChannel/StressLoopback.java
+4
-4
未找到文件。
test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
浏览文件 @
ce6b0326
...
...
@@ -44,9 +44,9 @@ public class GroupOfOne {
final
AsynchronousServerSocketChannel
listener
=
AsynchronousServerSocketChannel
.
open
()
.
bind
(
new
InetSocketAddress
(
0
));
listener
.
accept
(
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
listener
.
accept
(
(
Void
)
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
public
void
completed
(
AsynchronousSocketChannel
ch
,
Void
att
)
{
listener
.
accept
(
null
,
this
);
listener
.
accept
(
(
Void
)
null
,
this
);
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
}
...
...
@@ -81,13 +81,13 @@ public class GroupOfOne {
// 2. the close/shutdown completes
final
CountDownLatch
latch
=
new
CountDownLatch
(
2
);
ch
.
connect
(
sa
,
null
,
new
CompletionHandler
<
Void
,
Void
>()
{
ch
.
connect
(
sa
,
(
Void
)
null
,
new
CompletionHandler
<
Void
,
Void
>()
{
public
void
completed
(
Void
result
,
Void
att
)
{
System
.
out
.
println
(
"Connected"
);
// initiate I/O operation that does not complete (successfully)
ByteBuffer
buf
=
ByteBuffer
.
allocate
(
100
);
ch
.
read
(
buf
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
buf
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
throw
new
RuntimeException
();
}
...
...
test/java/nio/channels/AsynchronousChannelGroup/Identity.java
浏览文件 @
ce6b0326
...
...
@@ -78,15 +78,15 @@ public class Identity {
final
AsynchronousServerSocketChannel
listener
=
AsynchronousServerSocketChannel
.
open
()
.
bind
(
new
InetSocketAddress
(
0
));
listener
.
accept
(
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
listener
.
accept
(
(
Void
)
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
public
void
completed
(
final
AsynchronousSocketChannel
ch
,
Void
att
)
{
listener
.
accept
(
null
,
this
);
listener
.
accept
(
(
Void
)
null
,
this
);
final
ByteBuffer
buf
=
ByteBuffer
.
allocate
(
100
);
ch
.
read
(
buf
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
buf
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
buf
.
clear
();
ch
.
read
(
buf
,
null
,
this
);
ch
.
read
(
buf
,
(
Void
)
null
,
this
);
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
}
...
...
test/java/nio/channels/AsynchronousChannelGroup/Restart.java
浏览文件 @
ce6b0326
...
...
@@ -94,7 +94,7 @@ public class Restart {
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
listener
.
accept
(
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
listener
.
accept
(
(
Void
)
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
public
void
completed
(
AsynchronousSocketChannel
ch
,
Void
att
)
{
try
{
ch
.
close
();
...
...
test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
浏览文件 @
ce6b0326
...
...
@@ -45,10 +45,10 @@ public class Unbounded {
final
AsynchronousServerSocketChannel
listener
=
AsynchronousServerSocketChannel
.
open
()
.
bind
(
new
InetSocketAddress
(
0
));
listener
.
accept
(
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
listener
.
accept
(
(
Void
)
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
public
void
completed
(
AsynchronousSocketChannel
ch
,
Void
att
)
{
queue
.
add
(
ch
);
listener
.
accept
(
null
,
this
);
listener
.
accept
(
(
Void
)
null
,
this
);
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
}
...
...
test/java/nio/channels/AsynchronousDatagramChannel/Basic.java
浏览文件 @
ce6b0326
...
...
@@ -66,7 +66,7 @@ public class Basic {
// Test: datagram packet not received immediately
dst
.
clear
();
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
receive
(
dst
,
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
ch
.
receive
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
public
void
completed
(
SocketAddress
source
,
Void
att
)
{
latch
.
countDown
();
}
...
...
@@ -82,7 +82,7 @@ public class Basic {
// Test: timeout
dst
.
clear
();
final
AtomicReference
<
Throwable
>
exception
=
new
AtomicReference
<
Throwable
>();
ch
.
receive
(
dst
,
2
,
TimeUnit
.
SECONDS
,
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
ch
.
receive
(
dst
,
2
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
public
void
completed
(
SocketAddress
source
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -101,7 +101,7 @@ public class Basic {
// AsynchronousCloseException
dst
=
ByteBuffer
.
allocateDirect
(
100
);
exception
.
set
(
null
);
ch
.
receive
(
dst
,
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
ch
.
receive
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
public
void
completed
(
SocketAddress
source
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -156,7 +156,7 @@ public class Basic {
// Test: datagram packet not received immediately
dst
.
clear
();
final
CountDownLatch
l1
=
new
CountDownLatch
(
1
);
ch
.
read
(
dst
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
l1
.
countDown
();
}
...
...
@@ -172,7 +172,7 @@ public class Basic {
// Test: timeout
dst
.
clear
();
final
AtomicReference
<
Throwable
>
exception
=
new
AtomicReference
<
Throwable
>();
ch
.
read
(
dst
,
2
,
TimeUnit
.
SECONDS
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
dst
,
2
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -191,7 +191,7 @@ public class Basic {
// AsynchronousCloseException
dst
.
clear
();
exception
.
set
(
null
);
ch
.
read
(
dst
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -238,7 +238,7 @@ public class Basic {
// Test: send datagram packet to reader and check completion handler
// is invoked
final
CountDownLatch
l2
=
new
CountDownLatch
(
1
);
ch
.
send
(
ByteBuffer
.
wrap
(
msg
),
sa
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
send
(
ByteBuffer
.
wrap
(
msg
),
sa
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesSent
,
Void
att
)
{
if
(
bytesSent
!=
msg
.
length
)
throw
new
RuntimeException
(
"Unexpected number of bytes received"
);
...
...
@@ -261,7 +261,7 @@ public class Basic {
// Test: check that failed method is invoked
ch
.
close
();
final
CountDownLatch
l3
=
new
CountDownLatch
(
1
);
ch
.
send
(
ByteBuffer
.
wrap
(
msg
),
sa
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
send
(
ByteBuffer
.
wrap
(
msg
),
sa
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesSent
,
Void
att
)
{
throw
new
RuntimeException
(
"completed method invoked"
);
}
...
...
@@ -315,7 +315,7 @@ public class Basic {
// Test: write datagram and check completion handler is invoked
final
CountDownLatch
l2
=
new
CountDownLatch
(
1
);
ch
.
write
(
ByteBuffer
.
wrap
(
msg
),
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
write
(
ByteBuffer
.
wrap
(
msg
),
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesSent
,
Void
att
)
{
if
(
bytesSent
!=
msg
.
length
)
throw
new
RuntimeException
(
"Unexpected number of bytes received"
);
...
...
@@ -372,7 +372,7 @@ public class Basic {
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
long
timeout
=
(
i
==
0
)
?
0L
:
60L
;
Future
<
SocketAddress
>
remote
=
ch
.
receive
(
ByteBuffer
.
allocate
(
100
),
timeout
,
TimeUnit
.
SECONDS
,
null
,
.
receive
(
ByteBuffer
.
allocate
(
100
),
timeout
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
SocketAddress
,
Void
>()
{
public
void
completed
(
SocketAddress
source
,
Void
att
)
{
}
...
...
@@ -395,7 +395,7 @@ public class Basic {
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
long
timeout
=
(
i
==
0
)
?
0L
:
60L
;
Future
<
Integer
>
result
=
ch
.
read
(
ByteBuffer
.
allocate
(
100
),
timeout
,
TimeUnit
.
SECONDS
,
null
,
.
read
(
ByteBuffer
.
allocate
(
100
),
timeout
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
bytesRead
,
Void
att
)
{
}
...
...
test/java/nio/channels/AsynchronousFileChannel/Basic.java
浏览文件 @
ce6b0326
...
...
@@ -190,7 +190,7 @@ public class Basic {
if
(
fl
==
null
)
throw
new
RuntimeException
(
"Unable to acquire lock"
);
try
{
ch
.
lock
(
null
,
new
CompletionHandler
<
FileLock
,
Void
>
()
{
ch
.
lock
(
(
Void
)
null
,
new
CompletionHandler
<
FileLock
,
Void
>
()
{
public
void
completed
(
FileLock
result
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -217,7 +217,7 @@ public class Basic {
ByteBuffer
buf
=
ByteBuffer
.
allocateDirect
(
100
);
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
read
(
buf
,
0L
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
buf
,
0L
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
try
{
Thread
.
currentThread
().
interrupt
();
...
...
@@ -311,7 +311,7 @@ public class Basic {
final
AtomicReference
<
Thread
>
invoker
=
new
AtomicReference
<
Thread
>();
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
write
(
genBuffer
(),
0L
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
write
(
genBuffer
(),
0L
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
invoker
.
set
(
Thread
.
currentThread
());
latch
.
countDown
();
...
...
@@ -410,7 +410,7 @@ public class Basic {
// start write operation
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
Future
<
Integer
>
res
=
ch
.
write
(
genBuffer
(),
0L
,
null
,
Future
<
Integer
>
res
=
ch
.
write
(
genBuffer
(),
0L
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
}
...
...
test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java
浏览文件 @
ce6b0326
...
...
@@ -95,7 +95,7 @@ public class Basic {
final
AtomicReference
<
Throwable
>
exception
=
new
AtomicReference
<
Throwable
>();
// start accepting
listener
.
accept
(
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
listener
.
accept
(
(
Void
)
null
,
new
CompletionHandler
<
AsynchronousSocketChannel
,
Void
>()
{
public
void
completed
(
AsynchronousSocketChannel
ch
,
Void
att
)
{
try
{
ch
.
close
();
...
...
test/java/nio/channels/AsynchronousSocketChannel/Basic.java
浏览文件 @
ce6b0326
...
...
@@ -181,7 +181,7 @@ public class Basic {
}
final
AtomicReference
<
Throwable
>
connectException
=
new
AtomicReference
<
Throwable
>();
ch
.
connect
(
server
.
address
(),
null
,
new
CompletionHandler
<
Void
,
Void
>()
{
ch
.
connect
(
server
.
address
(),
(
Void
)
null
,
new
CompletionHandler
<
Void
,
Void
>()
{
public
void
completed
(
Void
result
,
Void
att
)
{
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -332,7 +332,7 @@ public class Basic {
// start read operation
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ByteBuffer
buf
=
ByteBuffer
.
allocate
(
1
);
Future
<
Integer
>
res
=
ch
.
read
(
buf
,
null
,
Future
<
Integer
>
res
=
ch
.
read
(
buf
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
}
...
...
@@ -397,11 +397,11 @@ public class Basic {
// reads should complete immediately
final
ByteBuffer
dst
=
ByteBuffer
.
allocateDirect
(
src
.
capacity
()
+
100
);
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
read
(
dst
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
int
n
=
result
;
if
(
n
>
0
)
{
ch
.
read
(
dst
,
null
,
this
);
ch
.
read
(
dst
,
(
Void
)
null
,
this
);
}
else
{
latch
.
countDown
();
}
...
...
@@ -450,10 +450,10 @@ public class Basic {
// read until the buffer is full
final
ByteBuffer
dst
=
ByteBuffer
.
allocateDirect
(
src
.
capacity
());
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
read
(
dst
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
read
(
dst
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
if
(
dst
.
hasRemaining
())
{
ch
.
read
(
dst
,
null
,
this
);
ch
.
read
(
dst
,
(
Void
)
null
,
this
);
}
else
{
latch
.
countDown
();
}
...
...
@@ -508,7 +508,7 @@ public class Basic {
// scattering read that completes ascynhronously
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
ch
.
read
(
dsts
,
0
,
dsts
.
length
,
0L
,
TimeUnit
.
SECONDS
,
null
,
ch
.
read
(
dsts
,
0
,
dsts
.
length
,
0L
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
Long
,
Void
>()
{
public
void
completed
(
Long
result
,
Void
att
)
{
long
n
=
result
;
...
...
@@ -536,7 +536,7 @@ public class Basic {
dsts
[
i
].
rewind
();
}
long
n
=
ch
.
read
(
dsts
,
0
,
dsts
.
length
,
0L
,
TimeUnit
.
SECONDS
,
null
,
null
).
get
();
.
read
(
dsts
,
0
,
dsts
.
length
,
0L
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
null
).
get
();
if
(
n
<=
0
)
throw
new
RuntimeException
(
"No bytes read"
);
...
...
@@ -562,10 +562,10 @@ public class Basic {
// write all bytes and close connection when done
final
ByteBuffer
src
=
genBuffer
();
ch
.
write
(
src
,
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
ch
.
write
(
src
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>()
{
public
void
completed
(
Integer
result
,
Void
att
)
{
if
(
src
.
hasRemaining
())
{
ch
.
write
(
src
,
null
,
this
);
ch
.
write
(
src
,
(
Void
)
null
,
this
);
}
else
{
try
{
ch
.
close
();
...
...
@@ -616,7 +616,7 @@ public class Basic {
// write buffers (should complete immediately)
ByteBuffer
[]
srcs
=
genBuffers
(
1
);
long
n
=
ch
.
write
(
srcs
,
0
,
srcs
.
length
,
0L
,
TimeUnit
.
SECONDS
,
null
,
null
).
get
();
.
write
(
srcs
,
0
,
srcs
.
length
,
0L
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
null
).
get
();
if
(
n
<=
0
)
throw
new
RuntimeException
(
"No bytes written"
);
...
...
@@ -629,7 +629,7 @@ public class Basic {
// write until socket buffer is full so as to create the conditions
// for when a write does not complete immediately
srcs
=
genBuffers
(
1
);
ch
.
write
(
srcs
,
0
,
srcs
.
length
,
0L
,
TimeUnit
.
SECONDS
,
null
,
ch
.
write
(
srcs
,
0
,
srcs
.
length
,
0L
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
new
CompletionHandler
<
Long
,
Void
>()
{
public
void
completed
(
Long
result
,
Void
att
)
{
long
n
=
result
;
...
...
@@ -639,7 +639,7 @@ public class Basic {
if
(
continueWriting
.
get
())
{
ByteBuffer
[]
srcs
=
genBuffers
(
8
);
ch
.
write
(
srcs
,
0
,
srcs
.
length
,
0L
,
TimeUnit
.
SECONDS
,
null
,
this
);
(
Void
)
null
,
this
);
}
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -717,7 +717,7 @@ public class Basic {
// this read should timeout
ByteBuffer
dst
=
ByteBuffer
.
allocate
(
512
);
try
{
ch
.
read
(
dst
,
3
,
TimeUnit
.
SECONDS
,
null
,
null
).
get
();
ch
.
read
(
dst
,
3
,
TimeUnit
.
SECONDS
,
(
Void
)
null
,
null
).
get
();
throw
new
RuntimeException
(
"Read did not timeout"
);
}
catch
(
ExecutionException
x
)
{
if
(!(
x
.
getCause
()
instanceof
InterruptedByTimeoutException
))
...
...
test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java
浏览文件 @
ce6b0326
...
...
@@ -99,7 +99,7 @@ public class StressLoopback {
void
start
()
{
sentBuffer
.
position
(
0
);
sentBuffer
.
limit
(
sentBuffer
.
capacity
());
channel
.
write
(
sentBuffer
,
null
,
new
CompletionHandler
<
Integer
,
Void
>
()
{
channel
.
write
(
sentBuffer
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>
()
{
public
void
completed
(
Integer
nwrote
,
Void
att
)
{
bytesSent
+=
nwrote
;
if
(
finished
)
{
...
...
@@ -107,7 +107,7 @@ public class StressLoopback {
}
else
{
sentBuffer
.
position
(
0
);
sentBuffer
.
limit
(
sentBuffer
.
capacity
());
channel
.
write
(
sentBuffer
,
null
,
this
);
channel
.
write
(
sentBuffer
,
(
Void
)
null
,
this
);
}
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
@@ -142,14 +142,14 @@ public class StressLoopback {
}
void
start
()
{
channel
.
read
(
readBuffer
,
null
,
new
CompletionHandler
<
Integer
,
Void
>
()
{
channel
.
read
(
readBuffer
,
(
Void
)
null
,
new
CompletionHandler
<
Integer
,
Void
>
()
{
public
void
completed
(
Integer
nread
,
Void
att
)
{
if
(
nread
<
0
)
{
closeUnchecked
(
channel
);
}
else
{
bytesRead
+=
nread
;
readBuffer
.
clear
();
channel
.
read
(
readBuffer
,
null
,
this
);
channel
.
read
(
readBuffer
,
(
Void
)
null
,
this
);
}
}
public
void
failed
(
Throwable
exc
,
Void
att
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录