Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

max value for SO_RCVBUF in Windows?

Quick question, wondering if anyone knew what the limit is for SO_RCVBUF under Windows.

like image 538
PiNoYBoY82 Avatar asked Feb 19 '09 15:02

PiNoYBoY82


3 Answers

SO_RCVBUF in winsock is not limited by the TCP window size. At least for pre-Vista stacks. It would be limited by non-paged pool availability, which is a whole different topic. So you can make it quite big, if you want to.

Obligatory unsolicited advice: If you are using a large buffer because you are receiving infrequently, I would look into asynchronous I/O with events/select/completion ports.

like image 127
a_mole Avatar answered Oct 11 '22 10:10

a_mole


I can't recall for sure, but I believe Windows supports the POSIX function fpathconf() with the _PC_SOCK_MAXBUF option. If so, this is exactly what you're looking for.

like image 28
dwc Avatar answered Oct 11 '22 10:10

dwc


Based on this article, it looks like the maximum is 64K.

like image 34
Michael Kristofik Avatar answered Oct 11 '22 10:10

Michael Kristofik