Example usage for io.netty.bootstrap ServerBootstrap childAttr

List of usage examples for io.netty.bootstrap ServerBootstrap childAttr

Introduction

In this page you can find the example usage for io.netty.bootstrap ServerBootstrap childAttr.

Prototype

public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value) 

Source Link

Document

Set the specific AttributeKey with the given value on every child Channel .

Usage

From source file:gwlpr.loginshard.LoginShardFactory.java

License:Open Source License

@Override
public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
    // set the attributes for new channels
    bootstrap.childAttr(ClientBean.HANDLE_KEY, null);

    // create the pipeline-factory
    bootstrap.childHandler(new LoginShardChannelInitializer(EncryptionOptions.Enable));

    // finally, bind and sync
    return bootstrap.bind(8112).sync().channel();
}

From source file:gwlpr.mapshard.MapShardFactory.java

License:Open Source License

@Override
public Channel getServerChannel(ServerBootstrap bootstrap) throws InterruptedException {
    // set the attributes for new channels
    bootstrap.childAttr(ClientBean.HANDLE_KEY, null);

    // create the pipeline-factory
    bootstrap.childHandler(new MapShardChannelInitializer(EncryptionOptions.Enable));

    // finally, bind and sync
    return bootstrap.bind(9112).sync().channel();
}