com.neko233.socket233.impl.tcp.pipeline.TcpChannelInitializer Maven / Gradle / Ivy
The newest version!
package com.neko233.socket233.impl.tcp.pipeline;
import com.neko233.socket233.core.NetworkEngine;
import com.neko233.socket233.impl.tcp.handler.TcpTransportLayerHandlerAdapter;
import com.neko233.socket233.netty.api.AbstractEngineChannelInitializer;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import org.jetbrains.annotations.NotNull;
/**
* @author SolarisNeko
* Date on 2022-12-16
*/
public class TcpChannelInitializer extends AbstractEngineChannelInitializer {
public TcpChannelInitializer(@NotNull NetworkEngine networkEngine) {
super(networkEngine);
}
@Override
protected void initChannel(Channel channel) throws Exception {
channel.pipeline()
.addLast(new TcpTransportLayerHandlerAdapter(this.getNetworkEngine()))
;
}
}