public class AioServerStarter extends AioStarter
| 限定符和类型 | 字段和说明 |
|---|---|
protected ServerConfig |
config
服务端配置
|
protected ReadCompletionHandler |
readCompletionHandler
读回调
|
protected WriteCompletionHandler |
writeCompletionHandler
写回调
|
asynchronousChannelGroup, channelPipeline, chunkPoolbossThreadNum, bossThreadPool, workerThreadNum, workerThreadPool| 构造器和说明 |
|---|
AioServerStarter(int port)
简单启动
|
AioServerStarter(ServerConfig config)
指定配置启动
|
AioServerStarter(String host,
int port)
指定host启动
|
| 限定符和类型 | 方法和说明 |
|---|---|
AioServerStarter |
bossThreadNum(int threadNum)
设置Boss线程数
|
AioServerStarter |
channelInitializer(ChannelPipeline channelPipeline)
责任链
|
void |
shutdown()
停止服务
|
void |
start()
启动AIO服务
|
AioServerStarter |
workerThreadNum(int threadNum) |
protected ServerConfig config
protected ReadCompletionHandler readCompletionHandler
protected WriteCompletionHandler writeCompletionHandler
public AioServerStarter(int port)
port - 服务端口public AioServerStarter(String host, int port)
host - 服务地址port - 服务端口public AioServerStarter(ServerConfig config)
config - 配置public AioServerStarter channelInitializer(ChannelPipeline channelPipeline)
channelPipeline - 责任链public AioServerStarter bossThreadNum(int threadNum)
threadNum - 线程数public AioServerStarter workerThreadNum(int threadNum)
public final void shutdown()
Copyright © 2021. All rights reserved.