Date: Mon, 27 Nov 2000 19:30:46 -0800 From: Lars Eggert <larse@ISI.EDU> To: questions@freebsd.org Subject: send(2) and resuming after ENOBUFS Message-ID: <3A2326E6.AD835284@isi.edu>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi, for an experiment, I'm writing a little tool that blasts large (9K) UDP packets at another host. I'm using connected sockets and send(2). Very quickly, send(2) returns indicating that the socket send buffer is full. So far, so good. My question is: How do I detect that the socket buffer has sufficiently emptied to resume sending? I tried setting the SO_SNDLOWAT to my message size and checking with select(2) if the socket is writable. However, select(2) always returns telling me it is, even though a following send(2) results in ENOBUFS. This may in fact be a bug in FreeBSD, since the setsockopt(2) man page seems to indicate that this should work: SO_SNDLOWAT is an option to set the minimum count for output operations. Most output operations process all of the data supplied by the call, de- livering data to the protocol for transmission and blocking as necessary for flow control. Nonblocking output operations will process as much da- ta as permitted subject to flow control without blocking, but will pro- cess no data if flow control does not allow the smaller of the low water mark value or the entire request to be processed. A select(2) operation testing the ability to write to a socket will return true only if the low water mark amount could be processed. The default value for SO_SNDLOWAT is set to a convenient size for network efficiency, often 1024. Any ideas? Spinning is not really an option... Thanks, Lars -- Lars Eggert <larse@isi.edu> Information Sciences Institute http://www.isi.edu/larse/ University of Southern California [-- Attachment #2 --] 0# *H 010 + 0 *H 00A#0 *H 010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.160 000824203008Z 010824203008Z0T10 UEggert1 0U*Lars10ULars Eggert10 *H larse@isi.edu00 *H 0 \p9 H;vr∩6"C?mxfJf7I[3CF́L I - zHRVA怤2]0-bL)%X>nӅ w0u0*+e!0 00L2uMyffBNUbNJJcdZ2s0U0 larse@isi.edu0U0 0U#0`fUXFa#Ì0 *H _3 F=%nWY-HXD9UOc6ܰwf@uܶNԄR?Pr}E1֮23mFhySwM_h|d yR=$P 00}0 *H 010 UZA10UWestern Cape10U Cape Town10U Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0) *H personal-freemail@thawte.com0 990916140140Z 010915140140Z010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.1600 *H 0 iZz]!#rLK~r$BRW{azr98e^eyvL>hput ,O 1ArƦ]D.Mօ>lx~@эWs0FO 7050U0 0U#0rIs4Uvr~wƲ0 *H kY1rr`HU{gapm¥7؝(V\uoƑlfq|ko!6- -mƃRt\~ orzg,ks nΝc) ~U100010 UZA10UWestern Cape10UDurbanville10 U Thawte10UCertificate Services1(0&UPersonal Freemail RSA 1999.9.16#0 + 0 *H 1 *H 0 *H 1 001128033046Z0# *H 12(*A\>-9I0R *H 1E0C0 *H 0*H 0+0 *H @0 *H (0 *H "Mti#Sɕ;I)c6>k7WYk֮͊ٲ ݸSbsHX- r+z-cL:'\oC6F]MU[|!W?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A2326E6.AD835284>
