Tabnine Logo
NettyHttpClient.request
Code IndexAdd Tabnine to your IDE (free)

How to use
request
method
in
com.mpush.netty.http.NettyHttpClient

Best Java code snippets using com.mpush.netty.http.NettyHttpClient.request (Showing top 1 results out of 315)

origin: mpusher/mpush

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
  RequestContext context = ctx.channel().attr(client.requestKey).getAndSet(null);
  try {
    if (context != null && context.tryDone()) {
      LOGGER.debug("receive server response, request={}, response={}", context, msg);
      HttpResponse response = (HttpResponse) msg;
      if (isRedirect(response)) {
        if (context.onRedirect(response)) {
          String location = getRedirectLocation(context.request, response);
          if (location != null && location.length() > 0) {
            context.cancelled.set(false);
            context.request.setUri(location);
            client.request(context);
            return;
          }
        }
      }
      context.onResponse(response);
    } else {
      LOGGER.warn("receive server response but timeout, request={}, response={}", context, msg);
    }
  } finally {
    client.pool.tryRelease(ctx.channel());
    ReferenceCountUtil.release(msg);
  }
}
com.mpush.netty.httpNettyHttpClientrequest

Popular methods of NettyHttpClient

  • <init>
  • writeRequest

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top Sublime Text plugins
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