Simplify ServerSocketSuspendTest
This commit is contained in:
parent
dca860e0d5
commit
47f26d219d
@ -22,9 +22,7 @@ import io.netty.channel.ChannelHandler;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundByteHandlerAdapter;
|
import io.netty.channel.ChannelInboundByteHandlerAdapter;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.util.NetworkConstants;
|
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -58,8 +56,9 @@ public class ServerSocketSuspendTest extends AbstractServerSocketTest {
|
|||||||
try {
|
try {
|
||||||
long startTime = System.nanoTime();
|
long startTime = System.nanoTime();
|
||||||
for (int i = 0; i < NUM_CHANNELS; i ++) {
|
for (int i = 0; i < NUM_CHANNELS; i ++) {
|
||||||
sockets.add(new Socket(
|
Socket s = new Socket();
|
||||||
NetworkConstants.LOCALHOST, ((InetSocketAddress) sc.localAddress()).getPort()));
|
s.connect(addr, 10000);
|
||||||
|
sockets.add(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc.pipeline().firstContext().readable(true);
|
sc.pipeline().firstContext().readable(true);
|
||||||
@ -76,8 +75,9 @@ public class ServerSocketSuspendTest extends AbstractServerSocketTest {
|
|||||||
try {
|
try {
|
||||||
long startTime = System.nanoTime();
|
long startTime = System.nanoTime();
|
||||||
for (int i = 0; i < NUM_CHANNELS; i ++) {
|
for (int i = 0; i < NUM_CHANNELS; i ++) {
|
||||||
sockets.add(new Socket(
|
Socket s = new Socket();
|
||||||
NetworkConstants.LOCALHOST, ((InetSocketAddress) sc.localAddress()).getPort()));
|
s.connect(addr, 10000);
|
||||||
|
sockets.add(s);
|
||||||
}
|
}
|
||||||
long endTime = System.nanoTime();
|
long endTime = System.nanoTime();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user