LA1TV / Hyperdeck-JS-Lib

A javascript library for communication with the Blackmagic Hyperdeck.
MIT License
26 stars 8 forks source link

clipsGet() Error thrown #12

Closed joshhodgson closed 8 years ago

joshhodgson commented 8 years ago
C:\Users\la1tv\Desktop\hyperdeckjs\node_modules\hyperdeck-js-lib\src\hyperdeck\parser.js:74
        throw new Error("Invalid payload. Unknown response code.");
        ^

Error: Invalid payload. Unknown response code.
    at Object.Parser.parse (C:\Users\la1tv\Desktop\hyperdeckjs\node_modules\hyperdeck-js-lib\src\hyperdeck\parser.js:74:15)
    at Socket.onData (C:\Users\la1tv\Desktop\hyperdeckjs\node_modules\hyperdeck-js-lib\src\hyperdeck\response-handler.js:12:23)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:529:20)
tjenkinson commented 8 years ago

The size of the response didn't fit in a single packet, meaning the data event would be fired multiple times (once for each packet), with the later times each containing the rest of the data. The incoming response is now buffered until it has been guaranteed that it has all been received.