From 9eb8eea2a81be6a20abb62544dc54a35ff4173a5 Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Thu, 13 Jul 2023 09:39:43 -0700 Subject: Implement `ping()`, `pong()`, `terminate()` for WebSocket client and server (#3257) --- src/bun.js/api/server.classes.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/bun.js/api/server.classes.ts') diff --git a/src/bun.js/api/server.classes.ts b/src/bun.js/api/server.classes.ts index b3d174957..3aaea871f 100644 --- a/src/bun.js/api/server.classes.ts +++ b/src/bun.js/api/server.classes.ts @@ -45,7 +45,6 @@ export default [ args: ["JSUint8Array", "bool"], }, }, - publishText: { fn: "publishText", length: 2, @@ -62,10 +61,21 @@ export default [ args: ["JSString", "JSUint8Array"], }, }, - + ping: { + fn: "ping", + length: 1, + }, + pong: { + fn: "pong", + length: 1, + }, close: { fn: "close", - length: 1, + length: 3, + }, + terminate: { + fn: "terminate", + length: 0, }, cork: { fn: "cork", @@ -103,11 +113,6 @@ export default [ fn: "isSubscribed", length: 1, }, - - // topics: { - // getter: "getTopics", - // }, - remoteAddress: { getter: "getRemoteAddress", cache: true, -- cgit v1.2.3