You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to feed a sequence of long JSON messages, several KiB each, via the UDP server, but I am unable to do that because I think nc breaks my message into 1 KiB chunks (1024 bytes) which results in an "unexpected end of input" error:
Problem parsing the message. UDP Server will be stopped.
[json.exception.parse_error.101] parse error at line 1, column 1025: syntax error while parsing object - unexpected end of input; expected '}'
I am using it as follows:
my_command | nc -u localhost 9870
my_command outputs large newline-separated JSON dicts. Here's one (it is a perfectly valid JSON dict):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to feed a sequence of long JSON messages, several KiB each, via the UDP server, but I am unable to do that because I think
nc
breaks my message into 1 KiB chunks (1024 bytes) which results in an "unexpected end of input" error:I am using it as follows:
my_command | nc -u localhost 9870
my_command
outputs large newline-separated JSON dicts. Here's one (it is a perfectly valid JSON dict):How do I make the UDP server wait for newline before attempting to parse the message? Or am I misunderstanding the nature of the problem?
Beta Was this translation helpful? Give feedback.
All reactions