Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-12-27 19:57:05


Christopher Kohlhoff wrote:
> My conclusion is that the single-host test exhibits pathological
> behaviour on Linux (and possibly other OSes). The problem arises
> due to UDP being an unreliable protocol.

UDP is only unreliable from the POV of the receiver, not of the sender.
UDP sends behave the same as TCP sends. Hence as far as the sender is
concerned all sends succeed, under normal circumstances that is.

> Let's consider the behaviour of the async test. We have:
>
> - One thread performing synchronous sends in a tight loop.
>
> - One thread performing asynchronous receives via the demuxer.
>
> Typically a UDP send will not block, so the synchronous loop
> performs sends until its timeslice finishes. This will rapidly
> fill the buffer on the receiving socket, and once that buffer is
> full the additional datagrams are discarded.

The sender doesn't discard. You might get send failures if you have the
send socket in non-blocking mode though. If it where any other way the
test that I wrote would show "missing" receives. But Calebs results show
all messages arriving, as would be expected from the localhost device.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk