MCPcopy
hub / github.com/Zephyruso/zashboard / send

Method send

src/api/singbox/websocket.ts:70–81  ·  view source on GitHub ↗
(message: MessageInitShape<Req>)

Source from the content-addressed store, hash-verified

68 }
69
70 send(message: MessageInitShape<Req>) {
71 const data = toBinary(this.options.requestSchema, create(this.options.requestSchema, message))
72 const frame = new Uint8Array(6 + data.length)
73 // frame[0]: websocket payload marker (0 = data); frame[1..5]: gRPC frame
74 // header (flag + big-endian length).
75 frame[2] = (data.length >>> 24) & 0xff
76 frame[3] = (data.length >>> 16) & 0xff
77 frame[4] = (data.length >>> 8) & 0xff
78 frame[5] = data.length & 0xff
79 frame.set(data, 6)
80 this.enqueue(frame)
81 }
82
83 finishSend() {
84 this.enqueue(FINISH_SEND)

Callers 7

[Symbol.asyncIterator]Function · 0.95
constructorMethod · 0.80
enqueueMethod · 0.80
attachMethod · 0.80
closeMethod · 0.80
removeDeviceMethod · 0.80
handleUrbMethod · 0.80

Calls 1

enqueueMethod · 0.95

Tested by

no test coverage detected