views:

204

answers:

1

I have an application using TCP on Windows XP. When I call getsockopt with the SO_RCVBUF option, it reports 8192 bytes. However, Wireshark shows the app advertising a receive buffer of 64K. How is this possible? To have a 64K receive window, doesn't it need a 64K buffer? Are there two different buffers?

A: 

Are you setting the window size yourself? Make sure you do that before connect(2) or accept(2). But again windows might be special in this regard, check the msdn.

Nikolai N Fetissov
No, I didn't set the window or the buffer myself. But regardless of who set the sizes, I don't understand how it can advertise a 64K receive window if it only has 8K of memory to hold incoming data.
Tim
It might be that winsock is just lying to you. It looks like 64K is the default for faster then 100Mbps connections under windows.
Nikolai N Fetissov