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.

OpenedSocketSession

interfaz

Sesión de transporte con el resultado de la autorización del hub.

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

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

Declaración #

ts
interface OpenedSocketSession extends SocketSession {
	readonly ready: Promise<boolean>
	settled(): Promise<void>
}

Example #

ts
const session = openSocketSession({ hub, name: "chat", request, roomId, peer, maxPendingBytes: 64 * 1024 });
if (!(await session.ready)) return; // el hub rechazó la conexión y cerró el peer
session.receive(JSON.stringify({ event: "message", payload: { text: "Hola" } }));
await session.settled();

Miembros #

ready #

propiedad sólo lectura

readonly ready: Promise<boolean>

Se resuelve con true cuando el hub acepta el peer y con false si lo rechaza; nunca rechaza.

settled #

método

settled(): Promise<void>

Se resuelve cuando se han procesado todos los mensajes recibidos hasta ahora; nunca rechaza.

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