congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ClientBootstrap.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jboss.netty.bootstrap.ClientBootstrap
constructor

Best Java code snippets using org.jboss.netty.bootstrap.ClientBootstrap.<init> (Showing top 20 results out of 873)

origin: apache/incubator-druid

);
final ClientBootstrap bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(bossPool, workerPool));
origin: MovingBlocks/Terasology

public ServerInfoService() {
  pool = Executors.newCachedThreadPool();
  factory = new NioClientSocketChannelFactory(pool, pool, 1, 1);
  bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new InfoRequestPipelineFactory());
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("keepAlive", true);
}
origin: apache/avro

this.connectTimeoutMillis = (Long)
  nettyClientBootstrapOptions.get(NETTY_CONNECT_TIMEOUT_OPTION);
bootstrap = new ClientBootstrap(channelFactory);
remoteAddr = addr;
origin: menacher/java-game-server

      worker);
this.bootstrap = new ClientBootstrap(this.channelFactory);
origin: apache/incubator-dubbo

@Override
protected void doOpen() throws Throwable {
  NettyHelper.setNettyLoggerFactory();
  bootstrap = new ClientBootstrap(channelFactory);
  // config
  // @see org.jboss.netty.channel.socket.SocketChannelConfig
  bootstrap.setOption("keepAlive", true);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("connectTimeoutMillis", getConnectTimeout());
  final NettyHandler nettyHandler = new NettyHandler(getUrl(), this);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    @Override
    public ChannelPipeline getPipeline() {
      NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);
      ChannelPipeline pipeline = Channels.pipeline();
      pipeline.addLast("decoder", adapter.getDecoder());
      pipeline.addLast("encoder", adapter.getEncoder());
      pipeline.addLast("handler", nettyHandler);
      return pipeline;
    }
  });
}
origin: apache/incubator-dubbo

@Override
protected void doOpen() throws Throwable {
  NettyHelper.setNettyLoggerFactory();
  bootstrap = new ClientBootstrap(channelFactory);
  // config
  // @see org.jboss.netty.channel.socket.SocketChannelConfig
  bootstrap.setOption("keepAlive", true);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("connectTimeoutMillis", getConnectTimeout());
  final NettyHandler nettyHandler = new NettyHandler(getUrl(), this);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    @Override
    public ChannelPipeline getPipeline() {
      NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);
      ChannelPipeline pipeline = Channels.pipeline();
      pipeline.addLast("decoder", adapter.getDecoder());
      pipeline.addLast("encoder", adapter.getEncoder());
      pipeline.addLast("handler", nettyHandler);
      return pipeline;
    }
  });
}
origin: alibaba/jstorm

public void start() {
  bootstrap = new ClientBootstrap(clientChannelFactory);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("reuseAddress", true);
  bootstrap.setOption("sendBufferSize", bufferSize);
  bootstrap.setOption("keepAlive", true);
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new StormClientPipelineFactory(this, stormConf));
  reconnect();
}
origin: MovingBlocks/Terasology

ClientBootstrap bootstrap = new ClientBootstrap(factory);
bootstrap.setPipelineFactory(new TerasologyClientPipelineFactory(this));
bootstrap.setOption("tcpNoDelay", true);
origin: weibocom/motan

bootstrap = new ClientBootstrap(channelFactory);
origin: com.ning/async-http-client

plainBootstrap = new ClientBootstrap(socketChannelFactory);
secureBootstrap = new ClientBootstrap(socketChannelFactory);
webSocketBootstrap = new ClientBootstrap(socketChannelFactory);
secureWebSocketBootstrap = new ClientBootstrap(socketChannelFactory);
origin: eBay/parallec

/**
 * Creates the tcpClient with proper handler.
 *
 * @return the bound request builder
 * @throws HttpRequestCreateException
 *             the http request create exception
 */
public ClientBootstrap bootStrapTcpClient()
    throws HttpRequestCreateException {
  ClientBootstrap tcpClient = null;
  try {
    // Configure the client.
    tcpClient = new ClientBootstrap(tcpMeta.getChannelFactory());
    // Configure the pipeline factory.
    tcpClient.setPipelineFactory(new MyPipelineFactory(TcpUdpSshPingResourceStore.getInstance().getTimer(),
        this, tcpMeta.getTcpIdleTimeoutSec())
    );
    tcpClient.setOption("connectTimeoutMillis",
        tcpMeta.getTcpConnectTimeoutMillis());
    tcpClient.setOption("tcpNoDelay", true);
   // tcpClient.setOption("keepAlive", true);
  } catch (Exception t) {
    throw new TcpUdpRequestCreateException(
        "Error in creating request in Tcpworker. "
            + " If tcpClient is null. Then fail to create.", t);
  }
  return tcpClient;
}
origin: com.facebook.nifty/nifty-client

private ClientBootstrap createClientBootstrap(@Nullable HostAndPort socksProxyAddress)
{
  if (socksProxyAddress != null) {
    return new Socks4ClientBootstrap(channelFactory, toInetAddress(socksProxyAddress));
  }
  else {
    return new ClientBootstrap(channelFactory);
  }
}
origin: com.couchbase.client/couchbase-client

protected ChannelFuture createChannel() {
 // Configure the client.
 bootstrap = new ClientBootstrap(factory);
 // Set up the event pipeline factory.
 bootstrap.setPipelineFactory(new BucketMonitorPipelineFactory());
 // Start the connection attempt.
 return bootstrap.connect(new InetSocketAddress(host, port));
}
origin: lihengming/java-codes

public static void main(String args[]) {
  // Client服务启动器
  ClientBootstrap bootstrap = new ClientBootstrap(
      new NioClientSocketChannelFactory(
          Executors.newCachedThreadPool(),
          Executors.newCachedThreadPool()));
  // 设置一个处理服务端消息和各种消息事件的类(Handler)
  bootstrap.setPipelineFactory(() -> Channels.pipeline(new HelloClientHandler()));
  // 连接到本地的8000端口的服务端
  bootstrap.connect(new InetSocketAddress("127.0.0.1", 8000));
}
origin: itisaid/Doris

public void init() {
  // initialize the connection factory, such as we need create connection pools here.
  // Configure the client.
  bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
                                   Executors.newCachedThreadPool()));
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new DorisClentNettyPipelineFactory());
  bootstrap.setOption("connectTimeoutMillis", CONNECT_TIME_OUT_MILLIS);
  bootstrap.setOption("tcpNoDelay", true);
}
origin: net.anthavio/hatatitla

public NettyTransport(SenderConfigurer config, ExecutorService executor) {
  client = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
      Executors.newCachedThreadPool()));
  client.setOption("connectTimeoutMillis", 10000);
  client.setOption("keepAlive", true);
  client.setPipelineFactory(new HttpClientPipelineFactory(true));
  channels = new DefaultChannelGroup();
}
origin: net.sourceforge.openutils/flazr

private static ClientBootstrap getBootstrap(final Executor executor, final ClientOptions options) {
  final ChannelFactory factory = new NioClientSocketChannelFactory(executor, executor);
  final ClientBootstrap bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new ClientPipelineFactory(options));
  bootstrap.setOption("tcpNoDelay" , true);
  bootstrap.setOption("keepAlive", true);
  return bootstrap;
}
origin: org.jboss.ws.native/jbossws-native-core

private NettyTransportHandler(URL url, ChannelPipelineFactory pipelineFactory)
{
 this.url = url;
 ChannelFactory factory = factoryProvider.getClientSocketChannelFactoryInstance();
 ClientBootstrap bootstrap = new ClientBootstrap(factory);
 bootstrap.setPipelineFactory(pipelineFactory);
 
 //Start the connection attempt
 bootstrap.setOption("tcpNoDelay", true);
 connectFuture = bootstrap.connect(getSocketAddress(url));
}
origin: net.sourceforge.openutils/openutils-mgnlmedia

private static ClientBootstrap getBootstrap(final Executor executor, final ClientOptions options)
{
  final ChannelFactory factory = new NioClientSocketChannelFactory(executor, executor);
  final ClientBootstrap bootstrap = new ClientBootstrap(factory);
  bootstrap.setPipelineFactory(new ClientPipelineFactory(options));
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("keepAlive", true);
  return bootstrap;
}
origin: com.alibaba.jstorm/jstorm-core

public void start() {
  bootstrap = new ClientBootstrap(clientChannelFactory);
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("reuseAddress", true);
  bootstrap.setOption("sendBufferSize", bufferSize);
  bootstrap.setOption("keepAlive", true);
  // Set up the pipeline factory.
  bootstrap.setPipelineFactory(new StormClientPipelineFactory(this, stormConf));
  reconnect();
}
org.jboss.netty.bootstrapClientBootstrap<init>

Javadoc

Creates a new instance with no ChannelFactory set. #setFactory(ChannelFactory) must be called before any I/O operation is requested.

Popular methods of ClientBootstrap

  • connect
    Attempts a new connection with the specified remoteAddress and the specified localAddress. If the sp
  • setPipelineFactory
  • setOption
  • releaseExternalResources
  • getPipeline
  • getFactory
  • setOptions
  • getOption
  • getOptions
  • shutdown
  • getPipelineFactory
  • setPipeline
  • getPipelineFactory,
  • setPipeline,
  • setFactory

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Join (org.hibernate.mapping)
  • CodeWhisperer alternatives
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