MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / processProtoBuf

Method processProtoBuf

packages/ibkr/src/decoder/base.ts:71–91  ·  view source on GitHub ↗

* Dispatch a protobuf-encoded message. * Mirrors: ibapi/decoder.py processProtoBuf()

(protoBuf: Buffer, msgId: number)

Source from the content-addressed store, hash-verified

69 * Mirrors: ibapi/decoder.py processProtoBuf()
70 */
71 processProtoBuf(protoBuf: Buffer, msgId: number): void {
72 if (msgId === 0) return
73
74 const handler = this.msgId2protoHandler.get(msgId)
75 if (!handler) {
76 console.log(`[ibkr] unhandled protobuf message: msgId=${msgId}, len=${protoBuf.length}`)
77 return
78 }
79
80 try {
81 handler(this, protoBuf)
82 } catch (e) {
83 if (e instanceof BadMessage) {
84 this.wrapper.error(
85 NO_VALID_ID, currentTimeMillis(),
86 BAD_MESSAGE.code(), BAD_MESSAGE.msg() + `protobuf msgId=${msgId}`, '',
87 )
88 }
89 throw e
90 }
91 }
92}

Callers 2

onMessageMethod · 0.45

Calls 7

getMethod · 0.65
logMethod · 0.65
errorMethod · 0.65
handlerFunction · 0.50
currentTimeMillisFunction · 0.50
codeMethod · 0.45
msgMethod · 0.45

Tested by

no test coverage detected