Garrett Wollman wrote:
> 
> <<On Tue, 13 Mar 2001 16:43:26 -0800, Lars Eggert <[EMAIL PROTECTED]> said:
> 
> > I'm considering changing this, so that a select-to-write on a UDP socket
> > will block until queue space becomes available.
> 
> Impossible.  The only way to find out whether a packet (or set of
> packets, or a fragment of a packet) would be successfully enqueued is
> to try it.  Even then there's no guarantee that it will get sent.
> 
> (Actually, ``impossible'' is too strong -- we could restructure the
> entire network stack to make it possible to speculatively send packets
> just to support this change in select() semantics.  It's merely
> impractical.)

You try to queue a packet, if fails, then you do things (e.g. use the UDP
soscket buffer to keep it around until later). The trick is that you need
to block with your network interface as a wait channel, and the dequeue
loop needs to wakeup the sleepers when the queue is draining. I agree that
it's not a trivial change, but I don't think it's impossible or
impractical.

Lars
-- 
Lars Eggert <[EMAIL PROTECTED]>                 Information Sciences Institute
http://www.isi.edu/larse/                University of Southern California

S/MIME Cryptographic Signature

Reply via email to