public class NioServerStarter extends NioStarter
| 限定符和类型 | 字段和说明 |
|---|---|
protected ServerConfig |
serverConfig
服务端配置
|
channelPipeline, chunkPool, socketModebossThreadNum, bossThreadPool, workerThreadNum, workerThreadPool| 构造器和说明 |
|---|
NioServerStarter(int port)
简单启动
|
NioServerStarter(ServerConfig config)
指定配置启动
|
NioServerStarter(String host,
int port)
指定host启动
|
| 限定符和类型 | 方法和说明 |
|---|---|
NioServerStarter |
bossThreadNum(int threadNum)
设置Boss线程数
|
NioServerStarter |
channelInitializer(ChannelPipeline channelPipeline)
责任链
|
void |
shutdown()
停止服务
|
NioServerStarter |
socketMode(SocketMode socketMode) |
void |
start()
启动IO服务
|
NioServerStarter |
workerThreadNum(int threadNum) |
protected ServerConfig serverConfig
public NioServerStarter(int port)
port - 服务端口public NioServerStarter(String host, int port)
host - 服务地址port - 服务端口public NioServerStarter(ServerConfig config)
config - 配置public NioServerStarter channelInitializer(ChannelPipeline channelPipeline)
channelPipeline - 责任链public NioServerStarter bossThreadNum(int threadNum)
threadNum - 线程数public NioServerStarter workerThreadNum(int threadNum)
public NioServerStarter socketMode(SocketMode socketMode)
public final void shutdown()
Copyright © 2021. All rights reserved.