Constructor and Description |
---|
WebServerHandler(WebServerConfig webConfig,
HttpDispatcher httpDispatcher,
WebSocketDispatcher webSocketDispatcher) |
Modifier and Type | Method and Description |
---|---|
void |
checkPause(IoSession session,
Request request)
Web 服务暂停检查
如果配置文件指定了 PauseURL 则转到 PauseURL 指定的URL, 否则关闭当前连接
|
HttpResponse |
disposeHttp(IoSession session,
HttpRequest httpRequest,
HttpResponse httpResponse)
Http 请求响应处理
|
HttpResponse |
disposeUpgrade(IoSession session,
HttpRequest httpRequest,
HttpResponse httpResponse) |
WebSocketFrame |
disposeWebSocket(IoSession session,
WebSocketFrame webSocketFrame)
WebSocket 帧处理
|
static HttpSessionState |
getAttachment(IoSession session) |
void |
initKeepAliveTimer()
初始化连接保持 Timer
|
Object |
onConnect(IoSession session)
连接成功事件
|
void |
onDisconnect(IoSession session)
连接断开事件
|
void |
onException(IoSession session,
Exception e)
异常事件
|
void |
onFlush(IoSession session)
Socket 缓冲区发送事件
|
void |
onIdle(IoSession session)
空闲事件
|
Object |
onReceive(IoSession session,
Object obj)
接收数据事件
|
void |
onSent(IoSession session,
Object obj)
发送数据事件
发送后调用
|
public WebServerHandler(WebServerConfig webConfig, HttpDispatcher httpDispatcher, WebSocketDispatcher webSocketDispatcher)
public static HttpSessionState getAttachment(IoSession session)
public void initKeepAliveTimer()
public Object onConnect(IoSession session)
IoHandler
public void onDisconnect(IoSession session)
IoHandler
onDisconnect
in interface IoHandler
session
- Session 对象public void checkPause(IoSession session, Request request)
session
- IoSession: Socket 会话对象request
- Request: HTTP 请求对象public Object onReceive(IoSession session, Object obj)
IoHandler
public HttpResponse disposeHttp(IoSession session, HttpRequest httpRequest, HttpResponse httpResponse)
session
- HTTP-Session 对象httpRequest
- HTTP 请求对象httpResponse
- HTTP 响应对象public HttpResponse disposeUpgrade(IoSession session, HttpRequest httpRequest, HttpResponse httpResponse)
public WebSocketFrame disposeWebSocket(IoSession session, WebSocketFrame webSocketFrame)
session
- HTTP-Session 对象webSocketFrame
- WebSocket 帧对象public void onSent(IoSession session, Object obj)
IoHandler
public void onFlush(IoSession session)
IoHandler
public void onException(IoSession session, Exception e)
IoHandler
onException
in interface IoHandler
session
- Session 对象e
- 异常信息Copyright © 2020 Voovan. All rights reserved.