* Send intial request * * @param {stream.InitialSender} initialSender Initial stream request sender *
(initialSender)
| 94 | * |
| 95 | */ |
| 96 | run(initialSender) { |
| 97 | let user = new strings.String(this.config.user), |
| 98 | userBuf = user.buffer(), |
| 99 | addr = new address.Address( |
| 100 | this.config.host.type, |
| 101 | this.config.host.address, |
| 102 | this.config.host.port |
| 103 | ), |
| 104 | addrBuf = addr.buffer(), |
| 105 | authMethod = new Uint8Array([this.config.auth]); |
| 106 | |
| 107 | let data = new Uint8Array(userBuf.length + addrBuf.length + 1); |
| 108 | |
| 109 | data.set(userBuf, 0); |
| 110 | data.set(addrBuf, userBuf.length); |
| 111 | data.set(authMethod, userBuf.length + addrBuf.length); |
| 112 | |
| 113 | initialSender.send(data); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Receive the initial stream request |