Connect protocol frame: [1-byte flags][4-byte BE length][payload]
(data: Uint8Array, flags = 0)
| 176 | |
| 177 | /** Connect protocol frame: [1-byte flags][4-byte BE length][payload] */ |
| 178 | function frameConnectMessage(data: Uint8Array, flags = 0): Buffer { |
| 179 | const frame = Buffer.alloc(5 + data.length); |
| 180 | frame[0] = flags; |
| 181 | frame.writeUInt32BE(data.length, 1); |
| 182 | frame.set(data, 5); |
| 183 | return frame; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Spawn the Node H2 bridge and return read/write handles. |
no outgoing calls
no test coverage detected