()
| 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( |
no test coverage detected