Reputation: 155
Here is some code:
public void channelReadComplete(ChannelHandlerContext ctx) {
ctx.flush();
//ctx.close();
}
I'm trying to test my server with apache -ab command. When ctx.close() is uncommented apache benchmark command "ab -c100 -n1000" executes normally, but when channel remains opened benchmark shows 70007 Timeout Exception. How can i keep all my connections opened?
Upvotes: 1
Views: 204
Reputation: 23567
You should close the Channel only if keep-alive header is not present and only once the response was full written. See the HttpHelloWorldServer example
Upvotes: 2