Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f5d53f78
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
f5d53f78
编写于
6月 16, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6961630: TEST_BUG: Several SocketChannel and Selector tests can fail with "address already in use"
Reviewed-by: chegar
上级
101a96ea
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
42 addition
and
77 deletion
+42
-77
test/ProblemList.txt
test/ProblemList.txt
+0
-15
test/java/nio/channels/Selector/ByteServer.java
test/java/nio/channels/Selector/ByteServer.java
+5
-2
test/java/nio/channels/Selector/CloseThenRegister.java
test/java/nio/channels/Selector/CloseThenRegister.java
+10
-8
test/java/nio/channels/Selector/ReadAfterConnect.java
test/java/nio/channels/Selector/ReadAfterConnect.java
+1
-1
test/java/nio/channels/Selector/SelectAfterRead.java
test/java/nio/channels/Selector/SelectAfterRead.java
+4
-4
test/java/nio/channels/Selector/SelectWrite.java
test/java/nio/channels/Selector/SelectWrite.java
+1
-1
test/java/nio/channels/SocketChannel/BigReadWrite.java
test/java/nio/channels/SocketChannel/BigReadWrite.java
+0
-1
test/java/nio/channels/SocketChannel/VectorIO.java
test/java/nio/channels/SocketChannel/VectorIO.java
+10
-23
test/java/nio/channels/SocketChannel/Write.java
test/java/nio/channels/SocketChannel/Write.java
+10
-21
test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java
...nnels/spi/SelectorProvider/inheritedChannel/EchoTest.java
+1
-1
未找到文件。
test/ProblemList.txt
浏览文件 @
f5d53f78
...
...
@@ -740,9 +740,6 @@ com/sun/nio/sctp/SctpChannel/Shutdown.java generic-all
# at SetLastModified.main(SetLastModified.java:107)
java/io/File/SetLastModified.java generic-all
# Fails on Fedora 9 x86, address in use
java/nio/channels/Selector/SelectWrite.java generic-all
# Fails on Windows 2000, times out
java/nio/channels/FileChannel/Transfer.java generic-all
...
...
@@ -756,9 +753,6 @@ com/sun/nio/sctp/SctpChannel/Receive.java generic-all
# Triggers a hotspot crash on Fedora 9 32bit -server and Windows X64 samevm
sun/nio/cs/TestUTF8.java generic-all
# Solaris sparc, socket timeout
java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh generic-all
# Runtime exception on windows X64, samevm mode
java/nio/channels/Selector/WakeupNow.java generic-all
...
...
@@ -818,15 +812,6 @@ java/nio/channels/ServerSocketChannel/AdaptServerSocket.java windows-all
java/nio/channels/SocketChannel/ConnectState.java windows-all
java/nio/channels/SocketChannel/FinishConnect.java windows-all
# Gets java.net.BindException alot (static port number?)
java/nio/channels/SocketChannel/VectorIO.java generic-all
# Solaris i586 java.net.BindExceptions
java/nio/channels/SocketChannel/VectorParams.java solaris-all
# Linux i586 address already in use, samevm issues
java/nio/channels/SocketChannel/Write.java generic-all
# Fails on all platforms due to overlap of JDK jar file contents:
sun/nio/cs/Test4200310.sh generic-all
...
...
test/java/nio/channels/Selector/ByteServer.java
浏览文件 @
f5d53f78
...
...
@@ -33,7 +33,6 @@ import java.net.ServerSocket;
public
class
ByteServer
{
public
static
final
int
PORT
=
31415
;
public
static
final
String
LOCALHOST
=
"localhost"
;
private
int
bytecount
;
private
Socket
socket
;
...
...
@@ -43,7 +42,11 @@ public class ByteServer {
public
ByteServer
(
int
bytecount
)
throws
Exception
{
this
.
bytecount
=
bytecount
;
serversocket
=
new
ServerSocket
(
PORT
);
serversocket
=
new
ServerSocket
(
0
);
}
public
int
port
()
{
return
serversocket
.
getLocalPort
();
}
public
void
start
()
{
...
...
test/java/nio/channels/Selector/CloseThenRegister.java
浏览文件 @
f5d53f78
...
...
@@ -32,17 +32,19 @@ import java.nio.channels.*;
public
class
CloseThenRegister
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Selector
sel
=
Selector
.
open
();
sel
.
close
();
ServerSocketChannel
ssc
=
ServerSocketChannel
.
open
();
try
{
Selector
s
=
Selector
.
open
();
s
.
close
();
ServerSocketChannel
c
=
ServerSocketChannel
.
open
();
c
.
socket
().
bind
(
new
InetSocketAddress
(
40000
));
c
.
configureBlocking
(
false
);
c
.
register
(
s
,
SelectionKey
.
OP_ACCEPT
);
ssc
.
bind
(
new
InetSocketAddress
(
0
));
ssc
.
configureBlocking
(
false
);
ssc
.
register
(
sel
,
SelectionKey
.
OP_ACCEPT
);
throw
new
RuntimeException
(
"register after close does not cause CSE!"
);
}
catch
(
ClosedSelectorException
cse
)
{
return
;
// expected
}
finally
{
ssc
.
close
();
}
throw
new
RuntimeException
(
"register after close does not cause CSE!"
);
}
}
test/java/nio/channels/Selector/ReadAfterConnect.java
浏览文件 @
f5d53f78
...
...
@@ -37,7 +37,7 @@ public class ReadAfterConnect {
ByteServer
server
=
new
ByteServer
(
0
);
// server: accept connection and do nothing
server
.
start
();
InetSocketAddress
isa
=
new
InetSocketAddress
(
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
),
ByteServer
.
PORT
);
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
),
server
.
port
()
);
Selector
sel
=
Selector
.
open
();
SocketChannel
sc
=
SocketChannel
.
open
();
sc
.
connect
(
isa
);
...
...
test/java/nio/channels/Selector/SelectAfterRead.java
浏览文件 @
f5d53f78
...
...
@@ -37,14 +37,14 @@ public class SelectAfterRead {
final
static
int
TIMEOUT
=
1000
;
public
static
void
main
(
String
[]
argv
)
throws
Exception
{
InetAddress
lh
=
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
);
// server: accept connection and write one byte
ByteServer
server
=
new
ByteServer
(
1
);
server
.
start
();
InetSocketAddress
isa
=
new
InetSocketAddress
(
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
),
ByteServer
.
PORT
);
Selector
sel
=
Selector
.
open
();
SocketChannel
sc
=
SocketChannel
.
open
();
sc
.
connect
(
isa
);
sc
.
connect
(
new
InetSocketAddress
(
lh
,
server
.
port
())
);
sc
.
read
(
ByteBuffer
.
allocate
(
1
));
sc
.
configureBlocking
(
false
);
sc
.
register
(
sel
,
SelectionKey
.
OP_READ
);
...
...
@@ -61,7 +61,7 @@ public class SelectAfterRead {
server
=
new
ByteServer
(
2
);
server
.
start
();
sc
=
SocketChannel
.
open
();
sc
.
connect
(
isa
);
sc
.
connect
(
new
InetSocketAddress
(
lh
,
server
.
port
())
);
sc
.
configureBlocking
(
false
);
sel
=
Selector
.
open
();
sc
.
register
(
sel
,
SelectionKey
.
OP_READ
);
...
...
test/java/nio/channels/Selector/SelectWrite.java
浏览文件 @
f5d53f78
...
...
@@ -39,7 +39,7 @@ public class SelectWrite {
// server: accept connection and do nothing
server
.
start
();
InetSocketAddress
isa
=
new
InetSocketAddress
(
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
),
ByteServer
.
PORT
);
InetAddress
.
getByName
(
ByteServer
.
LOCALHOST
),
server
.
port
()
);
Selector
sel
=
Selector
.
open
();
SocketChannel
sc
=
SocketChannel
.
open
();
sc
.
connect
(
isa
);
...
...
test/java/nio/channels/SocketChannel/BigReadWrite.java
浏览文件 @
f5d53f78
...
...
@@ -32,7 +32,6 @@ import java.nio.channels.*;
public
class
BigReadWrite
{
static
int
port
=
40170
;
static
int
testSize
=
15
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
test/java/nio/channels/SocketChannel/VectorIO.java
浏览文件 @
f5d53f78
...
...
@@ -36,8 +36,6 @@ import sun.misc.*;
public
class
VectorIO
{
static
int
port
=
40170
;
static
Random
generator
=
new
Random
();
static
int
testSize
;
...
...
@@ -55,20 +53,12 @@ public class VectorIO {
System
.
err
.
println
(
"Length "
+
testSize
);
Server
sv
=
new
Server
(
testSize
);
sv
.
start
();
do
{
try
{
Thread
.
currentThread
().
sleep
(
200
);
}
catch
(
InterruptedException
x
)
{
if
(
sv
.
finish
(
8000
)
==
0
)
throw
new
Exception
(
"Failed: Error in server thread"
);
}
}
while
(!
sv
.
ready
);
bufferTest
();
bufferTest
(
sv
.
port
());
if
(
sv
.
finish
(
8000
)
==
0
)
throw
new
Exception
(
"Failed: Length = "
+
testSize
);
}
static
void
bufferTest
()
throws
Exception
{
static
void
bufferTest
(
int
port
)
throws
Exception
{
ByteBuffer
[]
bufs
=
new
ByteBuffer
[
testSize
];
for
(
int
i
=
0
;
i
<
testSize
;
i
++)
{
String
source
=
"buffer"
+
i
;
...
...
@@ -105,17 +95,19 @@ public class VectorIO {
static
class
Server
extends
TestThread
{
static
int
port
=
40170
;
static
Random
generator
=
new
Random
();
int
testSize
;
volatile
boolean
ready
=
false
;
final
int
testSize
;
final
ServerSocketChannel
ssc
;
Server
(
int
testSize
)
{
Server
(
int
testSize
)
throws
IOException
{
super
(
"Server "
+
testSize
);
this
.
testSize
=
testSize
;
this
.
ssc
=
ServerSocketChannel
.
open
().
bind
(
new
InetSocketAddress
(
0
));
}
int
port
()
{
return
ssc
.
socket
().
getLocalPort
();
}
void
go
()
throws
Exception
{
...
...
@@ -133,16 +125,11 @@ public class VectorIO {
}
// Get a connection from client
ServerSocketChannel
ssc
=
ServerSocketChannel
.
open
();
SocketChannel
sc
=
null
;
try
{
ssc
.
configureBlocking
(
false
);
InetAddress
lh
=
InetAddress
.
getLocalHost
();
InetSocketAddress
isa
=
new
InetSocketAddress
(
lh
,
port
);
ssc
.
socket
().
bind
(
isa
);
ready
=
true
;
for
(;;)
{
sc
=
ssc
.
accept
();
...
...
test/java/nio/channels/SocketChannel/Write.java
浏览文件 @
f5d53f78
...
...
@@ -37,8 +37,6 @@ import sun.misc.*;
public
class
Write
{
static
int
port
=
40170
;
static
Random
generator
=
new
Random
();
static
int
testSize
=
15
;
...
...
@@ -46,20 +44,12 @@ public class Write {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
WriteServer
sv
=
new
WriteServer
();
sv
.
start
();
do
{
try
{
Thread
.
currentThread
().
sleep
(
200
);
}
catch
(
InterruptedException
x
)
{
if
(
sv
.
finish
(
8000
)
==
0
)
throw
new
Exception
(
"Failed: Error in server thread"
);
}
}
while
(!
sv
.
ready
);
bufferTest
();
bufferTest
(
sv
.
port
());
if
(
sv
.
finish
(
8000
)
==
0
)
throw
new
Exception
(
"Failed"
);
}
static
void
bufferTest
()
throws
Exception
{
static
void
bufferTest
(
int
port
)
throws
Exception
{
ByteBuffer
[]
bufs
=
new
ByteBuffer
[
testSize
];
for
(
int
i
=
0
;
i
<
testSize
;
i
++)
{
String
source
=
...
...
@@ -94,14 +84,18 @@ public class Write {
class
WriteServer
extends
TestThread
{
static
int
port
=
40170
;
static
Random
generator
=
new
Random
();
volatile
boolean
ready
=
false
;
WriteServer
()
{
final
ServerSocketChannel
ssc
;
WriteServer
()
throws
IOException
{
super
(
"WriteServer"
);
this
.
ssc
=
ServerSocketChannel
.
open
().
bind
(
new
InetSocketAddress
(
0
));
}
int
port
()
{
return
ssc
.
socket
().
getLocalPort
();
}
void
go
()
throws
Exception
{
...
...
@@ -112,15 +106,10 @@ class WriteServer extends TestThread {
ByteBuffer
buf
=
ByteBuffer
.
allocateDirect
(
5
);
// Get a connection from client
ServerSocketChannel
ssc
=
ServerSocketChannel
.
open
();
SocketChannel
sc
=
null
;
try
{
ssc
.
configureBlocking
(
false
);
InetAddress
lh
=
InetAddress
.
getLocalHost
();
InetSocketAddress
isa
=
new
InetSocketAddress
(
lh
,
port
);
ssc
.
socket
().
bind
(
isa
);
ready
=
true
;
for
(;;)
{
sc
=
ssc
.
accept
();
...
...
test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java
浏览文件 @
f5d53f78
...
...
@@ -141,7 +141,7 @@ public class EchoTest {
// and receive the echo
byte
b
[]
=
new
byte
[
msg
.
length
()
+
100
];
DatagramPacket
pkt2
=
new
DatagramPacket
(
b
,
b
.
length
);
dc
.
socket
().
setSoTimeout
(
2
000
);
dc
.
socket
().
setSoTimeout
(
5
000
);
dc
.
socket
().
receive
(
pkt2
);
if
(
pkt2
.
getLength
()
!=
msg
.
length
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录