Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

openSocketSession

función

Conecta un transporte ya actualizado al hub, con una cadena de recepción en serie. Los hosts que reconstruyen conexiones, como un Durable Object que despierta, la llaman directamente; el hub vuelve a autorizar la petición. Si la rechaza, cierra el peer con 4401 (sesión) o 4403 (autorización del canal), desde 1.1, o con 1008 por cualquier otro motivo.

ts
import { openSocketSession } from "@meekojs/meeko/server";

Source code src/server/runtime/upgrade.ts:230

Firma #

ts
function openSocketSession(options: OpenSocketSessionOptions): OpenedSocketSession

Parameters #

options OpenSocketSessionOptions

Hub, canal, petición, sala, peer y límite de bytes pendientes.

Returns #

OpenedSocketSession

La sesión, con ready y settled.

Example #

ts
import { openSocketSession } from "@meekojs/meeko/server";

const session = openSocketSession({ hub: app.socket!.hub, name: "chat", request, roomId: "general", peer, maxPendingBytes: 64 * 1024 });
socket.addEventListener("message", (event) => session.receive(event.data as string));
socket.addEventListener("close", () => session.closed());

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/upgrade.ts