node-json-socket
node-json-socket copied to clipboard
Parsing error
When I'm sending a lot of messages to the server, some messages fail, other messages are ok.
{ success: false,
error:
'Error: Invalid content length supplied (\\",\\"payload\\":{\\"name\\":\\"StatTrak™ USP-S | Cortex (Factory New)\\",\\"patternIndex\\":230}},\\"meta\\":{\\"id\\":\\"32826924962616033\\",\\"host\\":\\"127.0.0.1\\",\\"port\\":51906}}16"}316) in: ' }
{ success: false,
error:
'Error: Invalid content length supplied (ective (Minimal Wear)\\",\\"patternIndex\\":954}},\\"meta\\":{\\"id\\":\\"5835899799671969\\",\\"host\\":\\"127.0.0.1\\",\\"port\\":51906}}17"}318) in: ' }
Sometimes can't parse JSON.
{ success: false,
error:
'Error: Could not parse JSON: Unexpected number in JSON at position 320\nRequest data: {"success":false,"error":"Error: Could not parse JSON: Unexpected number in JSON at position 178\\nRequest data: {\\"data\\":{\\"action\\":\\"check\\",\\"payload\\":{\\"name\\":\\"StatTrak™ M4A4 | Royal Paladin (Factory New)\\",\\"patternIndex\\":959}},\\"meta\\":{\\"id\\":\\"32598132724562956\\",\\"host\\":\\"127.0.0.1\\",\\"port\\":51906}}18"}32' }
@bifot what a delimeter-symbol have you use?
By default it is # - and if this occured in body messages - parsing is broken.
You can pass custom delimeter like this:
var serverSocket = new JsonSocket(socket, { delimeter: "⁂"});