mirror of
https://github.com/tursom/TursomServer.git
synced 2025-01-14 22:30:48 +08:00
add AutoCloseWebSocketHandler
This commit is contained in:
parent
f53f5dfd94
commit
775bfbffc1
@ -0,0 +1,26 @@
|
||||
package cn.tursom.core.ws
|
||||
|
||||
import io.netty.buffer.ByteBuf
|
||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame
|
||||
|
||||
interface AutoCloseWebSocketHandler : WebSocketHandler {
|
||||
override fun readMessage(client: WebSocketClient, msg: TextWebSocketFrame) {
|
||||
super.readMessage(client, msg)
|
||||
msg.release()
|
||||
}
|
||||
|
||||
override fun readMessage(client: WebSocketClient, msg: ByteBuf) {
|
||||
super.readMessage(client, msg)
|
||||
msg.release()
|
||||
}
|
||||
|
||||
override fun readPing(client: WebSocketClient, msg: ByteBuf) {
|
||||
super.readPing(client, msg)
|
||||
msg.release()
|
||||
}
|
||||
|
||||
override fun readPong(client: WebSocketClient, msg: ByteBuf) {
|
||||
super.readPong(client, msg)
|
||||
msg.release()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user