Netty架构原理
https://www.w3cschool.cn/essential_netty_in_action/essential_netty_in_action-x7mn28bx.html
netty server创建
package com.cn.server;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import org.springframework.stereotype.Component;
import com.cn.common.core.codc.RequestDecoder;
import com.cn.common.core.codc.ResponseEncoder;
/**
* netty服务端入门
*
* @author -琴兽-
*
*/
@Component
public class Server {
/**
* 启动
*/
public void start() {
// 服务类
ServerBootstrap b = new ServerBootstrap();
// 创建boss和worker
EventLoopGroup bossGroup = new NioEventL
还没有评论,来说两句吧...