public abstract class WebSocketServlet extends HttpServlet implements Resourcable
当WebSocketServlet接收一个TCP连接后,进行协议判断,如果成功就会创建一个WebSocket。 WebSocketServlet | | WebSocketEngine WebSocketNode / \ / \ / \ WebSocket1 WebSocket2
详情见: https://redkale.org
HttpServlet.InnerActionEntry
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
anyuser |
protected Convert |
binaryConvert |
protected Cryptor |
cryptor |
static int |
DEFAILT_LIVEINTERVAL |
protected Convert |
jsonConvert |
protected int |
liveinterval |
protected java.util.logging.Logger |
logger |
protected boolean |
mergemsg |
protected java.lang.reflect.Type |
messageTextType |
protected WebSocketNode |
node |
protected ResourceFactory |
resourceFactory |
protected Convert |
sendConvert |
protected boolean |
single |
protected Convert |
textConvert |
static java.lang.String |
WEBPARAM__CRYPTOR |
static java.lang.String |
WEBPARAM__LIVEINTERVAL |
static java.lang.String |
WEBPARAM__WSMAXBODY |
static java.lang.String |
WEBPARAM__WSMAXCONNS |
static java.lang.String |
WEBPARAM__WSMERGEMSG |
static java.lang.String |
WEBPARAM__WSTHREADS |
protected int |
wsmaxbody |
protected int |
wsmaxconns |
protected int |
wsthreads |
RET_METHOD_ERROR, RET_SERVER_ERROR
限定符 | 构造器和说明 |
---|---|
protected |
WebSocketServlet() |
限定符和类型 | 方法和说明 |
---|---|
protected java.util.function.BiConsumer<WebSocket,java.lang.Object> |
createRestOnMessageConsumer() |
protected abstract <G extends java.io.Serializable,T> |
createWebSocket() |
protected WebSocketNode |
createWebSocketNode() |
void |
execute(HttpRequest request,
HttpResponse response) |
protected void |
initRestWebSocket(WebSocket websocket) |
java.lang.String |
resourceName() |
authenticate, postStart, preExecute
@Comment(value="WebScoket\u670d\u52a1\u5668\u7ed9\u5ba2\u6237\u7aef\u8fdb\u884cping\u64cd\u4f5c\u7684\u95f4\u9694\u65f6\u95f4, \u5355\u4f4d: \u79d2") public static final java.lang.String WEBPARAM__LIVEINTERVAL
@Comment(value="WebScoket\u670d\u52a1\u5668\u6700\u5927\u8fde\u63a5\u6570\uff0c\u4e3a0\u8868\u793a\u65e0\u9650\u5236") public static final java.lang.String WEBPARAM__WSMAXCONNS
@Comment(value="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 java.lang.String WEBPARAM__WSTHREADS
@Comment(value="\u6700\u5927\u6d88\u606f\u4f53\u957f\u5ea6, \u5c0f\u4e8e1\u8868\u793a\u65e0\u9650\u5236") public static final java.lang.String WEBPARAM__WSMAXBODY
@Comment(value="\u63a5\u6536\u5ba2\u6237\u7aef\u7684\u5206\u5305(last=false)\u6d88\u606f\u65f6\u662f\u5426\u81ea\u52a8\u5408\u5e76\u5305") public static final java.lang.String WEBPARAM__WSMERGEMSG
@Comment(value="\u52a0\u5bc6\u89e3\u5bc6\u5668") public static final java.lang.String WEBPARAM__CRYPTOR
@Comment(value="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
protected final java.util.logging.Logger logger
protected java.lang.reflect.Type messageTextType
protected boolean single
protected int liveinterval
protected int wsmaxconns
protected int wsthreads
protected int wsmaxbody
protected boolean anyuser
protected boolean mergemsg
protected Cryptor cryptor
protected Convert jsonConvert
protected Convert textConvert
protected Convert binaryConvert
protected Convert sendConvert
protected WebSocketNode node
protected ResourceFactory resourceFactory
public java.lang.String resourceName()
resourceName
在接口中 Resourcable
public final void execute(HttpRequest request, HttpResponse response) throws java.io.IOException
execute
在类中 HttpServlet
java.io.IOException
protected abstract <G extends java.io.Serializable,T> WebSocket<G,T> createWebSocket()
protected WebSocketNode createWebSocketNode()
protected void initRestWebSocket(WebSocket websocket)
protected java.util.function.BiConsumer<WebSocket,java.lang.Object> createRestOnMessageConsumer()