MCPcopy Index your code
hub / github.com/apache/tvm / handleInitHeader

Method handleInitHeader

web/src/rpc_server.ts:402–415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

400 }
401
402 private handleInitHeader(): void {
403 const reader = new ByteStreamReader(this.readFromBuffer(SizeOf.I32 * 2));
404 const magic = reader.readU32();
405 if (magic === RPC_MAGIC + 1) {
406 throw new Error("key: " + this.key + " has already been used in proxy");
407 } else if (magic === RPC_MAGIC + 2) {
408 throw new Error("RPCProxy do not have matching client key " + this.key);
409 }
410 assert(magic === RPC_MAGIC, this.url + " is not an RPC Proxy");
411 this.remoteKeyLength = reader.readU32();
412 assert(this.pendingBytes === 0);
413 this.requestBytes(this.remoteKeyLength);
414 this.state = RPCServerState.InitHeaderKey;
415 }
416
417 private handleInitHeaderKey(): void {
418 const remoteKey = Uint8ArrayToString(

Callers 1

onDataReadyMethod · 0.95

Calls 4

readFromBufferMethod · 0.95
readU32Method · 0.95
requestBytesMethod · 0.95
assertFunction · 0.90

Tested by

no test coverage detected