Examples of NettyOperationListener


Examples of org.serviceconnector.net.req.netty.NettyOperationListener

    this.pipelineFactory = new NettyHttpRequesterPipelineFactory(this.connectionContext, NettyConnectionAdpater.timer);
    this.bootstrap.setPipelineFactory(this.pipelineFactory);
    // Starts the connection attempt.
    this.remotSocketAddress = new InetSocketAddress(host, port);
    ChannelFuture future = bootstrap.connect(this.remotSocketAddress);
    this.operationListener = new NettyOperationListener();
    future.addListener(this.operationListener);
    try {
      // waits until operation is done
      this.channel = this.operationListener.awaitUninterruptibly(baseConf.getConnectionTimeoutMillis()).getChannel();
      // complete localSocketAdress
View Full Code Here

Examples of org.serviceconnector.net.req.netty.NettyOperationListener

  @Override
  public void stopListening() {
    try {
      if (this.channel != null) {
        ChannelFuture future = this.channel.close();
        NettyOperationListener operationListener = new NettyOperationListener();
        future.addListener(operationListener);
        try {
          operationListener.awaitUninterruptibly(Constants.TECH_LEVEL_OPERATION_TIMEOUT_MILLIS);
        } catch (CommunicationException ex) {
          LOGGER.error("disconnect", ex); // stopListening must continue
        }
      }
      if (this.serverThread != null) {
View Full Code Here

Examples of org.serviceconnector.net.req.netty.NettyOperationListener

  @Override
  public void stopListening() {
    try {
      if (this.channel != null) {
        ChannelFuture future = this.channel.close();
        NettyOperationListener operationListener = new NettyOperationListener();
        future.addListener(operationListener);
        try {
          operationListener.awaitUninterruptibly(Constants.TECH_LEVEL_OPERATION_TIMEOUT_MILLIS);
        } catch (CommunicationException ex) {
          LOGGER.error("disconnect", ex); // stopListening must continue
        }
      }
      if (this.serverThread != null) {
View Full Code Here

Examples of org.serviceconnector.net.req.netty.NettyOperationListener

      this.bootstrap.setOption("keepAlive", baseConf.getTcpKeepAlive());
    }
    // Start the connection attempt.
    this.remotSocketAddress = new InetSocketAddress(host, port);
    ChannelFuture future = bootstrap.connect(this.remotSocketAddress);
    operationListener = new NettyOperationListener();
    future.addListener(operationListener);
    try {
      this.channel = operationListener.awaitUninterruptibly(baseConf.getConnectionTimeoutMillis()).getChannel();
      // complete remotSocketAddress
      this.remotSocketAddress = (InetSocketAddress) this.channel.getRemoteAddress();
View Full Code Here

Examples of org.serviceconnector.net.req.netty.NettyOperationListener

      this.bootstrap.setOption("keepAlive", baseConf.getTcpKeepAliveInitiator());
    }
    // Start the connection attempt.
    this.remotSocketAddress = new InetSocketAddress(host, port);
    ChannelFuture future = bootstrap.connect(this.remotSocketAddress);
    operationListener = new NettyOperationListener();
    future.addListener(operationListener);
    try {
      this.channel = operationListener.awaitUninterruptibly(baseConf.getConnectionTimeoutMillis()).getChannel();
      // complete remotSocketAddress
      this.remotSocketAddress = (InetSocketAddress) this.channel.getRemoteAddress();
View Full Code Here

Examples of org.serviceconnector.net.req.netty.NettyOperationListener

    this.pipelineFactory = new NettyHttpRequesterPipelineFactory(this.connectionContext, NettyConnectionAdpater.timer);
    this.bootstrap.setPipelineFactory(this.pipelineFactory);
    // Starts the connection attempt.
    this.remotSocketAddress = new InetSocketAddress(host, port);
    ChannelFuture future = bootstrap.connect(this.remotSocketAddress);
    this.operationListener = new NettyOperationListener();
    future.addListener(this.operationListener);
    try {
      // waits until operation is done
      this.channel = this.operationListener.awaitUninterruptibly(baseConf.getConnectionTimeoutMillis()).getChannel();
      // complete localSocketAdress
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.