Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-07 Thread Gustavo Lopes
Em Mon, 07 Mar 2011 09:51:31 -, Stas Malyshev escreveu: I suppose this information could be queried, but would you want to do the cast and retrieve this data in every call say in a socket_read loop? I'd ask why you need socket_read and not just fread if you use streams? If you need d

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-07 Thread Stas Malyshev
Hi! I suppose this information could be queried, but would you want to do the cast and retrieve this data in every call say in a socket_read loop? I'd ask why you need socket_read and not just fread if you use streams? If you need deeper semantics, then yes, either you use resources or you c

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-07 Thread Gustavo Lopes
Em Mon, 07 Mar 2011 09:18:24 -, Stas Malyshev escreveu: I think we already have PHP_STREAM_AS_SOCKETD, which should be appropriate here, not? That will indeed give you a socket descriptor, but 1) it's not directly available to user-space. 2) you still have to create a socket extension r

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-07 Thread Stas Malyshev
Hi! I think we already have PHP_STREAM_AS_SOCKETD, which should be appropriate here, not? That will indeed give you a socket descriptor, but 1) it's not directly available to user-space. 2) you still have to create a socket extension resource in order to pass it to functions of that extension.

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-07 Thread Gustavo Lopes
Em Mon, 07 Mar 2011 01:37:44 -, Stas Malyshev escreveu: I think a better option would be a function to convert a php socket stream into a socket resource. That would avoid limiting this to socket_get_options/socket_set_options and polluting the socket ext functions prologue with these c

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-06 Thread Stas Malyshev
Hi! I think a better option would be a function to convert a php socket stream into a socket resource. That would avoid limiting this to socket_get_options/socket_set_options and polluting the socket ext functions prologue with these conversions. I think we already have PHP_STREAM_AS_SOCKETD,

Re: [PHP-DEV] [patch] allow socket_[gs]et_options() to work on streams

2011-03-05 Thread Gustavo Lopes
On Sat, 05 Mar 2011 15:19:31 -, Vincent NEGRIER wrote: The goal of this patch is to allow user handling of low level socket options for stream sockets created with stream_socket_*() or fsockopen() functions. I choose to extend the socket_get_options() and socket_set_options() funct