AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Using TCP and UDP in Go Code?
The con interface is suitable for most people using TCP. There's a packet con as well that's probably better suited for UDP, at least the way most people will use it. When you create this connection object, even though it's UDP, you give go an address that you want to communicate with. So when you write to thisobject, it will only write to that your destination. And when you read from this object, it'll only pay attention to UDP packets coming from that destination.