From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 12 13:50:26 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B941065670 for ; Mon, 12 Oct 2009 13:50:26 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id 257B68FC0A for ; Mon, 12 Oct 2009 13:50:26 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id EC1B1489C2; Mon, 12 Oct 2009 14:50:24 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BIdwVa6mb7rn; Mon, 12 Oct 2009 14:50:18 +0100 (BST) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 5E065488CF; Mon, 12 Oct 2009 14:50:18 +0100 (BST) Message-ID: <4AD333F4.2020304@tomjudge.com> Date: Mon, 12 Oct 2009 13:49:40 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Ivan Voras References: <4AD31431.4060503@comsys.com.ua> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: "global" TCP_NODELAY? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 13:50:26 -0000 Ivan Voras wrote: > Sergey Smitienko wrote: >> Ivan Voras пишет: >>> I'm trying to work around some extreme brain damageness in PHP (yes, >>> it sucks) which doesn't have a way to set TCP_NODELAY on stream >>> sockets so I'm wondering what are my other options? Is there a way >>> to set TCP_NODELAY system-wide? >> What's wrong with: >> >> > $socket = socket_create_listen(1223); >> socket_set_option($socket, SOL_SOCKET, TCP_NODELAY, 1); >> var_dump(socket_get_option($socket, SOL_SOCKET, TCP_NODELAY)); >> ?> > > These "socket objects" are completely different from fsockopen() > "stream socket objects", and socket_set_option() doesn't work on > those. Consequently, you cannot use fgets() and friends to work with > sockets created with socket_*() and there is apparently no way to wrap > sockets in streams. It's an already finished application that uses > stream-like functions (e.g. fgets() and friends) and rewriting it to > use raw socket recv() and send() would be nasty. Is this for php java bridge by any chance? If so I believe we have a patch floating around so that it can use UNIX sockets rather than INET ones. TJ