{packet, 4}
Roberto Ostinelli
ostinelli@REDACTED
Fri Apr 17 12:54:13 CEST 2020
>
> {packet, 4} means that your payload is prefixed with a 4 byte integer in
> network byte ordering that gives the length of the following payload data.
> Any data that is sent gets this length field prepended and for received
> data it is expected to be there. I don't think that is what you want?
>
Why not? :) Yes, this is what I want.
> Your JSON data is unlikely to be prefixed the length of the following
> payload, is it? So, unless you have another way of knowing the payload
> size, you only option is the stream parsing.
> I you have any influence on the transport protocol, why not switch to HTTP
> or better HTTP/2?
>
Why do you say that it's unlikely? It's a standard JSON-over-tcp
configuration. This allows for simple bidirectional message sending. I
really do not need any advantages of the HTTP(/2) overheads.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200417/98326188/attachment.htm>
More information about the erlang-questions
mailing list