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.

BunServerWebSocket

interfaz

Parte del ServerWebSocket de Bun que usa Meeko. Es un tipo estructural para que la entrada compile sin @types/bun.

ts
import type { BunServerWebSocket } from "@meekojs/meeko/bun";

Source code src/bun.ts:26

Declaración #

ts
interface BunServerWebSocket {
	readonly data: unknown
	readonly readyState: number
	send(message: string): number
	close(code?: number, reason?: string): void
	getBufferedAmount?(): number
}

Example #

ts
import type { BunServerWebSocket } from "@meekojs/meeko/bun";

const isOpen = (socket: BunServerWebSocket): boolean => socket.readyState === 1;

Miembros #

data #

propiedad sólo lectura

readonly data: unknown

Datos asociados en el upgrade.

readyState #

propiedad sólo lectura

readonly readyState: number

0 conectando, 1 abierto, 2 cerrando, 3 cerrado.

send #

método

send(message: string): number

Bytes enviados; -1 si queda en cola por contrapresión; 0 si se descarta.

close #

método

close(code?: number, reason?: string): void

Cierra la conexión.

getBufferedAmount #

método opcional

getBufferedAmount?(): number

Bytes salientes pendientes.

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/bun.ts