congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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