/**
* Handle keep alive as long as there's the request contains
* 'connection:Keep-Alive' header, no matter what the client is 1.0 or 1.1:
* http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.3.3.html#section-157
*/
public static void if_keepAliveRequest_then_resumeReading_else_closeOnComplete(
final HttpRequest request, final Channel channel, final ChannelFuture channelFuture
) {
// TODO:
// Add Connection: Close, or Keep-Alive?
// res.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
if (HttpUtil.isKeepAlive(request)) {
channelFuture.addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future) {
resumeReading(channel);
}
});
} else {
channelFuture.addListener(ChannelFutureListener.CLOSE);
}
}
NoRealPipelining.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:sinetja
作者:
评论列表
文章目录