Go Time: Golang, Software Engineering cover image

TCP & UDP

Go Time: Golang, Software Engineering

CHAPTER

TCP vs UDP - What's the Difference?

With TCP, like you know, your messages are getting there eventually. But with UDP, that's very much not the case. So for instance, we talked about reading data from a TCP connection in Go, you create a byte slice of a certain size and you will keep reading data into that until it's full or there's no more data to read. With UDP, it's different. If I send you four separate UDP packets, and they're sitting in your receive buffer, if you're using net.con, and you read, even if the byte slice you've allocated is large enough to hold all four of those messages, every invocation of read only returns one message at a time

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner