Example usage for io.netty.channel.socket ServerSocketChannel closeFuture

List of usage examples for io.netty.channel.socket ServerSocketChannel closeFuture

Introduction

In this page you can find the example usage for io.netty.channel.socket ServerSocketChannel closeFuture.

Prototype

ChannelFuture closeFuture();

Source Link

Document

Returns the ChannelFuture which will be notified when this channel is closed.

Usage

From source file:com.google.devtools.build.lib.remote.blobstore.http.HttpBlobStoreTest.java

License:Open Source License

private void closeServerChannel(ServerSocketChannel server) throws InterruptedException {
    if (server != null) {
        server.close();//  w  w  w  . j av  a 2  s. c o  m
        server.closeFuture().sync();
        server.eventLoop().shutdownGracefully().sync();
    }
}

From source file:cyril.server.io.LessThanNullSuite.java

License:Open Source License

public static final void runStandalone(NorthernerServer ns) {
    try {/*from   w w w  .ja va2s.  c  o  m*/
        ServerSocketChannel ch = (ServerSocketChannel) ns.channelFuture.sync().channel();

        System.out.println("Using channel " + ch + " (" + ch.getClass().getSimpleName() + ")");

        ch.closeFuture().sync();

        System.out.println("Has closed?!");
    } catch (InterruptedException e) {
        throw new ChannelException(e);
    } finally {
        System.out.println("Shutting down...");
        ns.bootstrap.shutdown();
    }
}