Interleaving writes on a TCP connection: are they atomic?

I have a TCP/IP server writing responses to a connected socket. (I use Socket.Stream.send, it may be different with raw :gen_tcp?)
Several Elixir processes run in parallel writing to the same socket. Is there a guarantee that each send will be atomic and will not interfere with other writes? Where exactly to find this information?

Each send is atomic, yes, regardless of whether data is sent right away or buffered.

1 Like