Re: Winsock2 SO_SNDBUF / UDP message send process
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Fri, 2 Feb 2007 10:59:26 -0800
There's no fixed buffer behind the socket as the model
suggests. There's buffer size. The actual buffer extends
and shrinks to hold as much data as necessary (it's not
even continuous piece of memory for that matter). BTW
you can easily abuse this elastic buffer by passing huge
sends (with TCP only, UDP has a maximum datagram
size) and eventually leading to out of buffers errors.
The socket won't accept any more data until its buffer
shrinks below the send buffer size (from data being
sent out).
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
<wforrester@xxxxxxxxx> wrote in message
news:1170406050.357638.26050@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
What will happen if my send buffer doesn't have enough capacity to
hold 80 bytes,
and Winsock hasn't had time to send the first 50 bytes datagram?
Will it discard the second packet or return some error code to me?
On Feb 1, 10:12 am, "Arkady Frenkel" <arka...@xxxxxxxxxxxxxxxx> wrote:
Why that bother you? TCP stack will send packets and that problem of peer
side to extract datagram exactly as needed. As about internals, TCP stack
should send data immediately : UDP doesn't wait for ACK opposite to TCP
where even if you disable Nagle algorithm stack wait for ACK from peer.
Arkady
<wforres...@xxxxxxxxx> wrote in message
news:1170238259.634504.143510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm asking whether multipe calls to send() with a UDP socket can get
coalesced into an internal buffer
and than sent in a separate UDP datagram each?
Example:
I call send() twice, passing 50 bytes and 30 bytes buffers.
If at the time of the second call, Winsock2 hasn't yet sent out first
50 bytes,
will it append next 30 bytes to its internal buffer (to send 2
datagrams later) and exit the call
or it will block until first 50 bytes are actually sent?
On Jan 30, 11:50 pm, "Skywing [MVP]"
<skywing_NO_SP...@xxxxxxxxxxxxxxxxxxx> wrote:
If you're asking whether multiple calls to send() with a UDP socket
can
get
coalesced into a single UDP datagram on the wire, the answer is no.
UDP
provides message boundaries, unlike TCP.
--
Ken Johnson (Skywing)
Windows SDK MVPhttp://www.nynaeve.net<wforres...@xxxxxxxxx> wrote in
message
news:1170194811.950280.146300@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Show quoted text -- Hide quoted text -
- Show quoted text -
.
- References:
- Re: Winsock2 SO_SNDBUF / UDP message send process
- From: Arkady Frenkel
- Re: Winsock2 SO_SNDBUF / UDP message send process
- From: wforrester
- Re: Winsock2 SO_SNDBUF / UDP message send process
- Prev by Date: Re: How relevant is "Automatic TCP Window Tuning" in Networking Applications ?
- Next by Date: Re: gethostbyname - how to use with a proxy name?
- Previous by thread: Re: Winsock2 SO_SNDBUF / UDP message send process
- Next by thread: Re: CreateIpForwardEntry
- Index(es):
Relevant Pages
|