From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 12 13:53:06 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 898F1106568B for ; Mon, 12 Oct 2009 13:53:06 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 450848FC1B for ; Mon, 12 Oct 2009 13:53:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1MxLKj-0002dR-0N for freebsd-hackers@freebsd.org; Mon, 12 Oct 2009 15:53:05 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 15:53:04 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2009 15:53:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Mon, 12 Oct 2009 15:52:47 +0200 Lines: 28 Message-ID: References: <4AD31431.4060503@comsys.com.ua> <4AD333F4.2020304@tomjudge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20090928) In-Reply-To: <4AD333F4.2020304@tomjudge.com> Sender: news 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:53:06 -0000 Tom Judge wrote: > 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. No, something in-house.