From bcaf3d76a28acf1e3bf26daf9d23c3e978e6550d Mon Sep 17 00:00:00 2001 From: xRain Date: Mon, 24 Aug 2026 23:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20handler=20=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0=E6=94=B9=E4=B8=BA=E5=8C=BF?= =?UTF-8?q?=E5=90=8D=E5=8F=82=E6=95=B0,=E9=80=9A=E8=BF=87=E5=8F=91?= =?UTF-8?q?=E5=B8=83=20MANDATORY=20=E8=A7=84=E8=8C=83=E6=A3=80=E6=9F=A5(G.?= =?UTF-8?q?FUN.02)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tests/websocket_test.cj | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tests/websocket_test.cj b/src/tests/websocket_test.cj index 52a1c88..a518913 100644 --- a/src/tests/websocket_test.cj +++ b/src/tests/websocket_test.cj @@ -64,12 +64,12 @@ class TestWsHandler <: IWebsocketHandler { conn.send("echo: ${msg.text.getOrThrow()}") } - public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit { + public override func onClose(_: WebSocketConnection, code: Int64, reason: String): Unit { harness.connCloseCode = code harness.connCloseReason = reason } - public override func onError(conn: WebSocketConnection, e: Exception): Unit { + public override func onError(_: WebSocketConnection, e: Exception): Unit { if (let we: WebSocketException <- e) { harness.connErrorCode = we.code } @@ -84,19 +84,19 @@ class EchoHandler <: IWebsocketHandler { this.harness = harness } - public override func onConnect(conn: WebSocketConnection): Unit { + public override func onConnect(_: WebSocketConnection): Unit { () } - public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit { + public override func onMessage(_: WebSocketConnection, msg: WebSocketMessage): Unit { harness.connMessage = msg.text.getOrThrow() } - public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit { + public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit { () } - public override func onError(conn: WebSocketConnection, e: Exception): Unit { + public override func onError(_: WebSocketConnection, _: Exception): Unit { () } } @@ -109,15 +109,15 @@ class CloseOnConnectHandler <: IWebsocketHandler { conn.close(code: 4000, reason: "svr") } - public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit { + public override func onMessage(_: WebSocketConnection, _: WebSocketMessage): Unit { () } - public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit { + public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit { () } - public override func onError(conn: WebSocketConnection, e: Exception): Unit { + public override func onError(_: WebSocketConnection, _: Exception): Unit { () } } @@ -128,15 +128,15 @@ class GroupJoinHandler <: IWebsocketHandler { conn.joinGroup("room") } - public override func onMessage(conn: WebSocketConnection, msg: WebSocketMessage): Unit { + public override func onMessage(_: WebSocketConnection, _: WebSocketMessage): Unit { () } - public override func onClose(conn: WebSocketConnection, code: Int64, reason: String): Unit { + public override func onClose(_: WebSocketConnection, _: Int64, _: String): Unit { () } - public override func onError(conn: WebSocketConnection, e: Exception): Unit { + public override func onError(_: WebSocketConnection, _: Exception): Unit { () } }