Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Oct 2009 13:49:40 +0000
From:      Tom Judge <tom@tomjudge.com>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: "global" TCP_NODELAY?
Message-ID:  <4AD333F4.2020304@tomjudge.com>
In-Reply-To: <hav5t5$u1t$1@ger.gmane.org>
References:  <hav3qp$n7n$1@ger.gmane.org> <4AD31431.4060503@comsys.com.ua> <hav5t5$u1t$1@ger.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
>>
>> <?php
>> $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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AD333F4.2020304>