Example usage for io.netty.handler.codec.http HttpVersion isKeepAliveDefault

List of usage examples for io.netty.handler.codec.http HttpVersion isKeepAliveDefault

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpVersion isKeepAliveDefault.

Prototype

public boolean isKeepAliveDefault() 

Source Link

Document

Returns true if and only if the connection is kept alive unless the "Connection" header is set to "close" explicitly.

Usage

From source file:org.asynchttpclient.netty.request.NettyRequestFactory.java

License:Open Source License

private String connectionHeader(boolean keepAlive, HttpVersion httpVersion) {
    if (httpVersion.isKeepAliveDefault()) {
        return keepAlive ? null : CLOSE;
    } else {/* w  w w . j  a  v a 2 s.c  om*/
        return keepAlive ? KEEP_ALIVE : null;
    }
}