expectedConfig.getFilterChain().addLast("mock", mockFilter);
acceptor.bind(new InetSocketAddress(port), mockHandler, expectedConfig);
try {
ConnectFuture future = connector.connect(new InetSocketAddress(
"localhost", port), new IoHandlerAdapter());
future.join();
WriteFuture writeFuture = future.getSession().write(
ByteBuffer.allocate(16).putInt(0).flip());
writeFuture.join();
Assert.assertTrue(writeFuture.isWritten());
future.getSession().close();
for (int i = 0; i < 30; i++) {
if (result.length() == 2) {
break;
}