API reference / @jsprismarine/script-host / debugger/framing
debugger/framing
Classes
Variables
FRAME_HEADER_BYTES
constFRAME_HEADER_BYTES:9=9
Defined in: script-host/src/debugger/framing.ts:11
The bytes of a frame's length header: 8 hexadecimal digits and a newline.
MAX_FRAME_LENGTH
constMAX_FRAME_LENGTH:4294967295=0xffffffff
Defined in: script-host/src/debugger/framing.ts:14
The largest length a header can state, its body's JSON and newline together.
MAX_RECEIVED_FRAME_LENGTH
constMAX_RECEIVED_FRAME_LENGTH:number
Defined in: script-host/src/debugger/framing.ts:24
The largest body the host reads from the extension: 1 MiB. The extension's messages are small, and the largest carry what a person writes: an evaluate expression, a command, or one file's breakpoint lines in setBreakpoints. A breakpoint list reaches the engine through its transfer buffer, DEFAULT_BUFFER_SIZE (64 KiB) unless an engine sets another size, and the limit is 16 times that, which leaves room for a pasted expression. A peer has given no passcode before its first message decodes, so a header that states more is refused before its body is buffered.
Functions
encodeFrame()
encodeFrame(
message):Buffer
Defined in: script-host/src/debugger/framing.ts:31
Frames one message.
Parameters
message
unknown
The message, which JSON can encode.
Returns
Buffer
The header, the JSON and its trailing newline.