(remote, reason, desc)
| 524 | sendPacket(this, this._packetRW.write.finalize(packet)); |
| 525 | } |
| 526 | channelOpenFail(remote, reason, desc) { |
| 527 | if (typeof desc !== 'string') |
| 528 | desc = ''; |
| 529 | |
| 530 | const descLen = Buffer.byteLength(desc); |
| 531 | let p = this._packetRW.write.allocStart; |
| 532 | const packet = this._packetRW.write.alloc(1 + 4 + 4 + 4 + descLen + 4); |
| 533 | |
| 534 | packet[p] = MESSAGE.CHANNEL_OPEN_FAILURE; |
| 535 | |
| 536 | writeUInt32BE(packet, remote, ++p); |
| 537 | |
| 538 | writeUInt32BE(packet, reason, p += 4); |
| 539 | |
| 540 | writeUInt32BE(packet, descLen, p += 4); |
| 541 | |
| 542 | p += 4; |
| 543 | if (descLen) { |
| 544 | packet.utf8Write(desc, p, descLen); |
| 545 | p += descLen; |
| 546 | } |
| 547 | |
| 548 | writeUInt32BE(packet, 0, p); // Empty language tag |
| 549 | |
| 550 | this._debug |
| 551 | && this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${remote})`); |
| 552 | sendPacket(this, this._packetRW.write.finalize(packet)); |
| 553 | } |
| 554 | |
| 555 | // =========================================================================== |
| 556 | // Client-specific =========================================================== |
no test coverage detected