Defjs
Core

ManualSocketCloseReason

Close code and reason recorded when a session is closed with session.close.

@defjs/core · Type

Signature

type ManualSocketCloseReason = {
  code?: number;
  kind: "manual-web-socket-close";
  reason?: string;
};

Records the code and reason passed to session.close(code?, reason?). They fill code and reason of the final { kind: 'closed' } close info when the peer's close event carries none. close throws a DOMException when a provided code is not the integer 1000 or an integer from 3000 through 4999, and when reason exceeds 123 UTF-8 bytes. Omitting code is allowed.

Members

Prop

Type

code? number | undefined
kind "manual-web-socket-close"
reason? string | undefined
Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao