[erlang-questions] How does Erlang TCP determine the end of a TCP stream?

scott ribe scott_ribe@REDACTED
Tue Oct 31 16:42:48 CET 2017


On Oct 31, 2017, at 8:41 AM, code wiget <codewiget95@REDACTED> wrote:
> 
> Handle_info({tcp/ssl, Sock, Data}, State) -> … and every time that I receive data into the socket, it comes as the “full package”, meaning that when another server sends a message to it over the socket, It is received as the full length of the packet every time with no extra bytes here or there.

Pure coincidence. Yes, it is highly likely that a single send on one end comes through a single receive on the other end, but there is no guarantee so you must figure out framing yourself.

--
Scott Ribe
https://www.linkedin.com/in/scottribe/
(303) 722-0567




More information about the erlang-questions mailing list