summaryrefslogtreecommitdiff
path: root/op_crates/websocket/01_websocket.js
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/websocket/01_websocket.js')
-rw-r--r--op_crates/websocket/01_websocket.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/op_crates/websocket/01_websocket.js b/op_crates/websocket/01_websocket.js
index 60fd7d467..17ba601a2 100644
--- a/op_crates/websocket/01_websocket.js
+++ b/op_crates/websocket/01_websocket.js
@@ -99,7 +99,7 @@
this.#url = wsURL.href;
- core.jsonOpSync("op_ws_check_permission", this.#url);
+ core.opSync("op_ws_check_permission", this.#url);
if (protocols && typeof protocols === "string") {
protocols = [protocols];
@@ -114,7 +114,7 @@
);
}
- core.jsonOpAsync("op_ws_create", {
+ core.opAsync("op_ws_create", {
url: wsURL.href,
protocols: protocols.join(", "),
}).then((create) => {
@@ -124,7 +124,7 @@
this.#protocol = create.protocol;
if (this.#readyState === CLOSING) {
- core.jsonOpAsync("op_ws_close", {
+ core.opAsync("op_ws_close", {
rid: this.#rid,
}).then(() => {
this.#readyState = CLOSED;
@@ -229,7 +229,7 @@
const sendTypedArray = (ta) => {
this.#bufferedAmount += ta.size;
- core.jsonOpAsync("op_ws_send", {
+ core.opAsync("op_ws_send", {
rid: this.#rid,
kind: "binary",
}, ta).then(() => {
@@ -256,7 +256,7 @@
const encoder = new TextEncoder();
const d = encoder.encode(string);
this.#bufferedAmount += d.size;
- core.jsonOpAsync("op_ws_send", {
+ core.opAsync("op_ws_send", {
rid: this.#rid,
kind: "text",
text: string,
@@ -287,7 +287,7 @@
} else if (this.#readyState === OPEN) {
this.#readyState = CLOSING;
- core.jsonOpAsync("op_ws_close", {
+ core.opAsync("op_ws_close", {
rid: this.#rid,
code,
reason,
@@ -307,7 +307,7 @@
async #eventLoop() {
while (this.#readyState === OPEN) {
- const message = await core.jsonOpAsync(
+ const message = await core.opAsync(
"op_ws_next_event",
this.#rid,
);
@@ -344,7 +344,7 @@
}
case "ping":
- core.jsonOpAsync("op_ws_send", {
+ core.opAsync("op_ws_send", {
rid: this.#rid,
kind: "pong",
});