public class WebsocketDispatcher extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static io.netty.util.AttributeKey<Map<String,List<String>>> |
REQUEST_PARAM |
static io.netty.util.AttributeKey<IWsSession<?>> |
SESSION_KEY |
static io.netty.util.AttributeKey<Map<String,String>> |
URI_TEMPLATE |
| 构造器和说明 |
|---|
WebsocketDispatcher(WebsocketProperties properties,
org.springframework.beans.factory.BeanFactory beanFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
doBeforeHandshake(io.netty.channel.Channel channel,
io.netty.handler.codec.http.FullHttpRequest req,
String path)
执行握手
|
void |
doOnBinary(io.netty.channel.Channel channel,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame) |
void |
doOnClose(io.netty.channel.Channel channel) |
void |
doOnError(io.netty.channel.Channel channel,
Throwable throwable) |
void |
doOnEvent(io.netty.channel.Channel channel,
Object evt) |
void |
doOnMessage(io.netty.channel.Channel channel,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame) |
void |
doOnOpen(io.netty.channel.Channel channel,
io.netty.handler.codec.http.FullHttpRequest req,
String path) |
boolean |
hasBeforeHandshake(io.netty.channel.Channel channel,
String path)
判定是否实现握手相关函数
|
void |
registerEndpoint(String path,
WebsocketMethodMapping desc) |
protected void |
releaseSession(io.netty.channel.ChannelHandlerContext ctx) |
void |
startSocketServer() |
public static final io.netty.util.AttributeKey<IWsSession<?>> SESSION_KEY
public WebsocketDispatcher(WebsocketProperties properties, org.springframework.beans.factory.BeanFactory beanFactory)
public void registerEndpoint(String path, WebsocketMethodMapping desc)
public void startSocketServer()
public boolean hasBeforeHandshake(io.netty.channel.Channel channel,
String path)
public void doBeforeHandshake(io.netty.channel.Channel channel,
io.netty.handler.codec.http.FullHttpRequest req,
String path)
throws Exception
Exceptionpublic void doOnOpen(io.netty.channel.Channel channel,
io.netty.handler.codec.http.FullHttpRequest req,
String path)
throws Exception
Exceptionprotected void releaseSession(io.netty.channel.ChannelHandlerContext ctx)
public void doOnClose(io.netty.channel.Channel channel)
public void doOnError(io.netty.channel.Channel channel,
Throwable throwable)
public void doOnMessage(io.netty.channel.Channel channel,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
public void doOnBinary(io.netty.channel.Channel channel,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
public void doOnEvent(io.netty.channel.Channel channel,
Object evt)
Copyright © 2022. All rights reserved.