Thank you, that has clarified what I was wanting to confirm. Dan
On Sun, 2019-05-12 at 20:00 -0700, Kurtis Rader wrote: > On Sun, May 12, 2019 at 7:38 PM Dan Kortschak <d...@kortschak.io> > wrote: > > > > > Yes, I'm aware of all this. However, the net.UDPConn Read method > > states > > that it "Read implements the Conn Read method", and does not the > > io.Reader interface; net.Conn has the explicit method, not an > > embedding > > of io.Reader. > > > And the Conn documentation says: "Conn is a generic stream-oriented > network > connection." UDP sockets are not stream-oriented. As Robert has > already > pointed out the Read() method on such an object is a wrapper around > the > read() syscall. Which for a UDP socket is equivalent to recv() with > flags > set to zero. You can't use it to read multiple packets with a single > call. > Nor can you use it to read a packet incrementally. At least on UNIX > like > platforms the excess bytes will be discarded. > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1557716944.29848.8.camel%40kortschak.io. For more options, visit https://groups.google.com/d/optout.