FAQ
In addition to the out-of-order reception, there is no guarantee that a
packet arrives at all.
UDP does not do retransmission of lost packets.. It has no notion of lost
or received packets at all.

You will need to build a reliability layer on top of UDP to do this.
If guaranteed reception in the right order is something you really need,
it is probably better to just use TCP.

If you do require UDP and don't mind getting your hands dirty, this might
be of some help:
https://github.com/jteeuwen/xudp

It is still very low level, as it does not automatically resend lost
packets, but it does keep track
of ACK'ed and lost packets for you. It notifies you through an event
handler at which point you
can handle the situation as you want. It should be relatively easy to build
an in-order buffered
reader on top of an xudp.Connection.


On Friday, August 31, 2012 1:24:33 PM UTC+2, Dave Cheney wrote:

While net.UDPConn implements Read(), there is no guarantee that reads
will occur in the same sequence that they were sent. This may be
problem for your use case.
On Fri, Aug 31, 2012 at 6:18 PM, liamzebedee wrote:
Is there any way to buffer reads (read a packet into a bytes.Buffer struct)
from something that implements net.PacketConn (UDP etc.) I wish to just get
the contents of the next packet and put it into a dynamically sized buffer.
If I didn't need the address, I could do it this way.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 7 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 31, '12 at 8:18a
activeSep 1, '12 at 10:35a
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase