3 ms·
The "it's all there" part is important, and sometimes not being a stream is a big advantage. When you write a protocol using TCP you inevitably have to send th
by drblast 11y ago
The "it's all there" part is important, and sometimes not being a stream is a big advantage.
When you write a protocol using TCP you inevitably have to send the "content length" as part of the protocol, and then you have to account for spoofing of that number and other ways an attacker can create a denial of service, and also account for breaks in transmission. It's a pain in the ass for anything where you'd want to send small messages.
- acomjean 11y agoI really do like that when you get a UDP message, its the whole thing is nice. UDP is awesomely easy, and I honestly liked it better as long as the messages are small. (although I'm old enough to remember whole computers with 1 UDP packet worth:64K bytes of memory, that isn't alot today) The loop and keep reading of tcp does gets tiresome, and if the sender goes down broken pipe...Memory allocation for the read... We used a lot udp and udp multicast, and it was great to be able to fire up a diagnosing tool to join the multicast group and listen in. Though in multicast the OS networking stack handles keeping your subscription, with no intervention from the software.