| 限定符和类型 | 字段和说明 |
|---|---|
protected T |
assistant |
protected ServerConfig |
config |
protected boolean |
isStarted |
protected Listener |
listener |
protected Processor |
processor |
protected Collection<Session> |
sessions |
| 构造器和说明 |
|---|
ServerBase(ServerConfig config,
T assistant) |
| 限定符和类型 | 方法和说明 |
|---|---|
Server |
config(ServerConfigHandler configHandler)
配置
|
T |
getAssistant()
获取通道助理
|
ServerConfig |
getConfig()
获取配置
|
Processor |
getProcessor()
获取处理器
|
Server |
listen(Listener listener)
设置监听器
|
void |
onClose(Session s)
关闭时
|
void |
onError(Session s,
Throwable e)
出错时
|
void |
onMessage(Session s,
Message m)
收到消息时
|
void |
onOpen(Session s)
打开时
|
void |
prestop()
预停止
|
protected void |
prestopDo()
执行预停止(发送 close-starting 指令)
|
void |
stop()
停止
|
protected void |
stopDo()
执行预停止(发送 close 指令)
|
protected final Processor processor
protected final Collection<Session> sessions
protected Listener listener
protected final ServerConfig config
protected final T extends ChannelAssistant assistant
protected boolean isStarted
public ServerBase(ServerConfig config, T assistant)
public T getAssistant()
public ServerConfig getConfig()
public Server config(ServerConfigHandler configHandler)
public Processor getProcessor()
public void onOpen(Session s) throws IOException
ListeneronOpen 在接口中 Listeners - 会话IOExceptionpublic void onMessage(Session s, Message m) throws IOException
ListeneronMessage 在接口中 Listeners - 会话m - 消息IOExceptionprotected void prestopDo()
protected void stopDo()
Copyright © 2024. All rights reserved.