2 ms·
That and TCP can send more the 64k Bytes at a time. UDP is really fast, multicast! and when you get a message its all there (not a stream) . For large messages
by acomjean 12y ago
That and TCP can send more the 64k Bytes at a time.
UDP is really fast, multicast! and when you get a message its all there (not a stream) . For large messages breaking them/ reassembling them into chunks is a pain.. By the time you do all the processing/ handshaking you end up back at TCP.
Interestingly the size limit is around 64k and varries slightly between Solaris, hpux and linux.
- drblast 12y agoThe "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 12y 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.