Change default socket buffer size under Windows
47,350
From this
To set the default size of the Windows use the following DWORD
registry keys :
[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet\Services\Afd\Parameters]
DefaultReceiveWindow = 10240
DefaultSendWindow = 10240
Author by
Bruno Martinez
Updated on November 20, 2020Comments
-
Bruno Martinez over 3 years
An application I cannot change is dropping some incoming UDP packets. I suspect that the receive buffer is overflowing. Is there a registry setting to make the default buffer larger than 8KB?
-
Tariq almost 9 yearsDo I need to create DefaultReceiveWindow & DefaultSendWindow under [HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet\Services\Afd\Parameters]? As these are not available in my registry.
-
zangw almost 9 yearsYou can try it, system reboot is required after changed.
-
Tariq almost 9 yearsThanks. I added the values and rebooted my system. Set both values to 16384. I reached to this thread while looking for a solution to missing RTP packets during decoding RTSP stream using FFMPEG. I still see RTP packet drop from RTSP stream in the decoding process.
-
zangw almost 9 yearsThere is one API in socket can get the buffer size, Sorry I cannot recall it clearly, And I am using phone now. I will give you this API once I got it
-
zangw almost 9 years@Tariq Please try
getsockopt
with parameterSO_SNDBUF
, you can get the socket buffer size. BTW, you can set the size of socket buffer throughsetsockopt
with parameterSO_SNDBUF
. -
Jannes over 7 yearsBad answer. Question is about UDP. Answer is about TCP.