congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
HttpVersion.isKeepAliveDefault
Code IndexAdd Tabnine to your IDE (free)

How to use
isKeepAliveDefault
method
in
org.jboss.netty.handler.codec.http.HttpVersion

Best Java code snippets using org.jboss.netty.handler.codec.http.HttpVersion.isKeepAliveDefault (Showing top 3 results out of 315)

origin: io.netty/netty

/**
 * Returns {@code true} if and only if the connection can remain open and
 * thus 'kept alive'.  This methods respects the value of the
 * {@code "Connection"} header first and then the return value of
 * {@link HttpVersion#isKeepAliveDefault()}.
 */
public static boolean isKeepAlive(HttpMessage message) {
  String connection = message.headers().get(Names.CONNECTION);
  boolean close = Values.CLOSE.equalsIgnoreCase(connection);
  if (close) {
    return false;
  }
  if (message.getProtocolVersion().isKeepAliveDefault()) {
    return !close;
  } else {
    return Values.KEEP_ALIVE.equalsIgnoreCase(connection);
  }
}
origin: io.netty/netty

if (message.getProtocolVersion().isKeepAliveDefault()) {
  if (keepAlive) {
    h.remove(Names.CONNECTION);
origin: cgbystrom/sockjs-netty

/** Handle conditional connection close depending on keep-alive */
private void writeResponse(Channel channel, HttpRequest request, HttpResponse response) {
  response.setHeader(CONTENT_LENGTH, response.getContent().readableBytes());
  boolean hasKeepAliveHeader = KEEP_ALIVE.equalsIgnoreCase(request.getHeader(CONNECTION));
  if (!request.getProtocolVersion().isKeepAliveDefault() && hasKeepAliveHeader) {
    response.setHeader(CONNECTION, KEEP_ALIVE);
  }
  ChannelFuture wf = channel.write(response);
  if (!HttpHeaders.isKeepAlive(request)) {
    wf.addListener(ChannelFutureListener.CLOSE);
  }
}
org.jboss.netty.handler.codec.httpHttpVersionisKeepAliveDefault

Javadoc

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

Popular methods of HttpVersion

  • equals
  • getText
    Returns the full protocol version text such as "HTTP/1.0".
  • getMajorVersion
    Returns the name of the protocol such as 1 in "HTTP/1.0".
  • getMinorVersion
    Returns the name of the protocol such as 0 in "HTTP/1.0".
  • getProtocolName
    Returns the name of the protocol such as "HTTP" in "HTTP/1.0".
  • toString
    Returns the full protocol version text such as "HTTP/1.0".
  • valueOf
    Returns an existing or new HttpVersion instance which matches to the specified protocol version stri
  • <init>
    Creates a new HTTP version with the specified version string. You will not need to create a new inst
  • compareTo

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now