- java.lang.Object
-
- org.redkale.net.Servlet<HttpContext,HttpRequest,HttpResponse>
-
- org.redkale.net.http.HttpServlet
-
- org.redkale.net.http.WebSocketServlet
-
- 所有已实现的接口:
Resourcable
public abstract class WebSocketServlet extends HttpServlet implements Resourcable
当WebSocketServlet接收一个TCP连接后,进行协议判断,如果成功就会创建一个WebSocket。 WebSocketServlet | | WebSocketEngine WebSocketNode / \ / \ / \ WebSocket1 WebSocket2
详情见: https://redkale.org
- 作者:
- zhangjx
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.redkale.net.http.HttpServlet
HttpServlet.ActionEntry
-
-
字段概要
字段 修饰符和类型 字段 说明 protected boolean
anyuser
protected Convert
binaryConvert
protected Cryptor
cryptor
static int
DEFAILT_LIVEINTERVAL
protected Convert
jsonConvert
protected int
liveinterval
protected Logger
logger
protected MessageAgent
messageAgent
protected Type
messageRestType
protected boolean
permessageDeflate
protected ResourceFactory
resourceFactory
protected Convert
sendConvert
protected boolean
single
protected Convert
textConvert
static String
WEBPARAM_CRYPTOR
static String
WEBPARAM_LIVEINTERVAL
static String
WEBPARAM_WSMAXBODY
static String
WEBPARAM_WSMAXCONNS
static String
WEBPARAM_WSTHREADS
protected WebSocketNode
webSocketNode
protected int
wsmaxbody
protected int
wsmaxconns
protected int
wsthreads
-
从类继承的字段 org.redkale.net.Servlet
_nonBlocking
-
-
构造器概要
构造器 限定符 构造器 说明 protected
WebSocketServlet()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected BiConsumer<WebSocket,Object>
createRestOnMessageConsumer()
protected abstract <G extends Serializable,T>
WebSocket<G,T>createWebSocket()
protected WebSocketNode
createWebSocketNode()
void
execute(HttpRequest request, HttpResponse response)
protected void
initRestWebSocket(WebSocket websocket)
String
resourceName()
-
从类继承的方法 org.redkale.net.http.HttpServlet
authenticate, finish404, finish405, postStart, preExecute
-
从类继承的方法 org.redkale.net.Servlet
destroy, init, isNonBlocking
-
-
-
-
字段详细资料
-
WEBPARAM_LIVEINTERVAL
@Comment("WebScoket\u670d\u52a1\u5668\u7ed9\u5ba2\u6237\u7aef\u8fdb\u884cping\u64cd\u4f5c\u7684\u95f4\u9694\u65f6\u95f4, \u5355\u4f4d: \u79d2") public static final String WEBPARAM_LIVEINTERVAL
- 另请参阅:
- 常量字段值
-
WEBPARAM_WSMAXCONNS
@Comment("WebScoket\u670d\u52a1\u5668\u6700\u5927\u8fde\u63a5\u6570\uff0c\u4e3a0\u8868\u793a\u65e0\u9650\u5236") public static final String WEBPARAM_WSMAXCONNS
- 另请参阅:
- 常量字段值
-
WEBPARAM_WSTHREADS
@Comment("WebScoket\u670d\u52a1\u5668\u64cd\u4f5cWebSocketNode\u5bf9\u5e94CacheSource\u5e76\u53d1\u6570, \u4e3a-1\u8868\u793a\u65e0\u9650\u5236\uff0c\u4e3a0\u8868\u793a\u7cfb\u7edf\u9ed8\u8ba4\u503c(CPU*8)") public static final String WEBPARAM_WSTHREADS
- 另请参阅:
- 常量字段值
-
WEBPARAM_WSMAXBODY
@Comment("\u6700\u5927\u6d88\u606f\u4f53\u957f\u5ea6, \u5c0f\u4e8e1\u8868\u793a\u65e0\u9650\u5236") public static final String WEBPARAM_WSMAXBODY
- 另请参阅:
- 常量字段值
-
WEBPARAM_CRYPTOR
@Comment("\u52a0\u5bc6\u89e3\u5bc6\u5668") public static final String WEBPARAM_CRYPTOR
- 另请参阅:
- 常量字段值
-
DEFAILT_LIVEINTERVAL
@Comment("WebScoket\u670d\u52a1\u5668\u7ed9\u5ba2\u6237\u7aef\u8fdb\u884cping\u64cd\u4f5c\u7684\u9ed8\u8ba4\u95f4\u9694\u65f6\u95f4, \u5355\u4f4d: \u79d2") public static final int DEFAILT_LIVEINTERVAL
- 另请参阅:
- 常量字段值
-
logger
protected final Logger logger
-
messageRestType
protected Type messageRestType
-
single
protected boolean single
-
liveinterval
protected int liveinterval
-
wsmaxconns
protected int wsmaxconns
-
wsthreads
protected int wsthreads
-
wsmaxbody
protected int wsmaxbody
-
anyuser
protected boolean anyuser
-
cryptor
protected Cryptor cryptor
-
permessageDeflate
protected boolean permessageDeflate
-
messageAgent
protected MessageAgent messageAgent
-
jsonConvert
protected Convert jsonConvert
-
textConvert
protected Convert textConvert
-
binaryConvert
protected Convert binaryConvert
-
sendConvert
protected Convert sendConvert
-
webSocketNode
protected WebSocketNode webSocketNode
-
resourceFactory
protected ResourceFactory resourceFactory
-
-
方法详细资料
-
resourceName
public String resourceName()
- 指定者:
resourceName
在接口中Resourcable
-
execute
public final void execute(HttpRequest request, HttpResponse response) throws IOException
- 覆盖:
execute
在类中HttpServlet
- 抛出:
IOException
-
createWebSocket
protected abstract <G extends Serializable,T> WebSocket<G,T> createWebSocket()
-
createWebSocketNode
protected WebSocketNode createWebSocketNode()
-
initRestWebSocket
protected void initRestWebSocket(WebSocket websocket)
-
createRestOnMessageConsumer
protected BiConsumer<WebSocket,Object> createRestOnMessageConsumer()
-
-