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 convert. I'm not against the conversion function, per se, but the regular API shouldn't force it's use (see below).
I also don't think magically mixing PHP streams and socket resources is a good idea, users may start to think PHP streams and socket resources are interchangeable and will be (even more) confused when they can't use socket resources with the stream functions.
We don't have alternative to setting socket options on a stream. Neither we want one - why have two functions for doing the same thing?
-- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php