TheWildgoose has asked for the wisdom of the Perl Monks concerning the following question:
For various reasons I have a requirement to have an app listening on localhost which is proxying output from another app that is not under my control. Currently the OS is buffering too much data (I think >XP the OS buffers >64KB ish?) and I need to try and find a way to crank down the OS buffers without making a system wide registry change
The solution appeared to be to use the TCP_MAXSEG option:
setsockopt($server, &Socket::IPPROTO_TCP, &Socket::TCP_MAXSEG, 2048);
However, on activestate at least this is giving me:
Your vendor has not defined Socket macro TCP_MAXSEG, used at xxx
Any ideas on how I can control OS buffering on Win32? (I need it portable eventually, but win32 is my problem right now)
I believe that the trick on windows is to set the advertised MSS window (as above) and this then changes the window size that the sender uses
Right now I can use SO_RCVBUF on the receiving side to turn down the receive buffer, but I am still having problems with the sending buffer (which is outside my control) being way too large for my requirements
Any help please?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Control TCP_MAXSEG (OS buffering) on Win32
by BrowserUk (Patriarch) on Nov 08, 2007 at 13:42 UTC | |
|
Re: Control TCP_MAXSEG (OS buffering) on Win32
by weismat (Friar) on Nov 08, 2007 at 22:32 UTC | |
by TheWildgoose (Initiate) on Nov 09, 2007 at 00:03 UTC | |
by Anonymous Monk on Nov 09, 2007 at 03:45 UTC | |
by TheWildgoose (Initiate) on Nov 09, 2007 at 16:53 UTC | |
by BrowserUk (Patriarch) on Nov 09, 2007 at 17:20 UTC |