下面列出了io.netty.channel.ChannelMetadata#io.netty.channel.DefaultChannelConfig 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public DefaultChannelConfig config() {
return config;
}
/**
* Create a new instance with the channel ID set to the given ID and the pipeline
* initialized with the specified handlers.创建一个新实例,将通道ID设置为给定的ID,并使用指定的处理程序初始化管道。
*
* @param channelId the {@link ChannelId} that will be used to identify this channel
* @param register {@code true} if this {@link Channel} is registered to the {@link EventLoop} in the
* constructor. If {@code false} the user will need to call {@link #register()}.
* @param hasDisconnect {@code false} if this {@link Channel} will delegate {@link #disconnect()}
* to {@link #close()}, {@link false} otherwise.
* @param handlers the {@link ChannelHandler}s which will be add in the {@link ChannelPipeline}
*/
public EmbeddedChannel(ChannelId channelId, boolean register, boolean hasDisconnect,
final ChannelHandler... handlers) {
super(null, channelId);
metadata = metadata(hasDisconnect);
config = new DefaultChannelConfig(this);
setup(register, handlers);
}