MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / writeFrame

Function writeFrame

src/daemon/framing.ts:7–12  ·  view source on GitHub ↗
(socket: net.Socket, obj: unknown)

Source from the content-addressed store, hash-verified

5 * Format: 4-byte big-endian length + JSON payload
6 */
7export function writeFrame(socket: net.Socket, obj: unknown): void {
8 const json = Buffer.from(JSON.stringify(obj), 'utf8');
9 const header = Buffer.alloc(4);
10 header.writeUInt32BE(json.length, 0);
11 socket.write(Buffer.concat([header, json]));
12}
13
14/**
15 * Create a frame reader that buffers incoming data and emits complete messages.

Callers 5

requestMethod · 0.90
invokeToolMethod · 0.90
startDaemonServerFunction · 0.90
streamFragmentFunction · 0.90

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected