Edit report at http://bugs.php.net/bug.php?id=51879&edit=1
ID: 51879 Patch added by: s...@php.net Reported by: suppakilla at gmail dot com Summary: Add the ability to set the TCP_NODELAY flag for socket streams Status: Assigned Type: Feature/Change Request Package: Streams related Operating System: * PHP Version: Irrelevant Assigned To: johannes Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: add-tcp-nodelay Revision: 1297974430 URL: http://bugs.php.net/patch-display.php?bug=51879&patch=add-tcp-nodelay&revision=1297974430 Previous Comments: ------------------------------------------------------------------------ [2011-02-17 20:11:23] s...@php.net So the attached patch should be good now, as you (johannes) said TCP_NODELAY is used without ifdef [1] already so it should be fine to use it as is. Now if I could have php-src karma to commit it myself it'd make my day, but I guess that's not good enough :) [1] http://lxr.php.net/opengrok/xref/PHP_5_3/ext/mysqlnd/mysqlnd_net.c#50 ------------------------------------------------------------------------ [2011-02-17 20:08:25] s...@php.net The following patch has been added/updated: Patch Name: add-tcp-nodelay Revision: 1297969705 URL: http://bugs.php.net/patch-display.php?bug=51879&patch=add-tcp-nodelay&revision=1297969705 ------------------------------------------------------------------------ [2011-02-17 19:45:59] s...@php.net So.. I attached a patch, but I have not tested it (can't compile on this machine) and it's also the first time I touch PHP's sources, so given my little C experience it may very well be incorrect. But I wanted to show goodwill. Hopefully someone picks this up and implements this small feature. ------------------------------------------------------------------------ [2011-02-17 19:44:16] s...@php.net The following patch has been added/updated: Patch Name: add-tcp-nodelay Revision: 1297968256 URL: http://bugs.php.net/patch-display.php?bug=51879&patch=add-tcp-nodelay&revision=1297968256 ------------------------------------------------------------------------ [2010-05-24 11:57:52] suppakilla at gmail dot com In relation to http://bugs.php.net/bug.php?id=46360 I think it would be useful to have the ability to set the TCP_NODELAY flag on socket streams. The arguments for this feature request are basically the same as of #6360, and it would greatly help with performances under certain circumstances when dealing with chatty network protocols. The following snippet is an example of how the resulting code might look like in a PHP script: $opts = array( 'socket' => array( 'tcp_nodelay' => false, ), ); $ctx = stream_context_create($opts); $stream = stream_socket_client($uri, $errno, $errstr, $timeout, $flags, $ctx); Cheers, Daniele Alessandri ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=51879 -- Edit this bug report at http://bugs.php.net/bug.php?id=51879&edit=1