|
From: <veg...@gm...> - 2005-03-15 19:47:11
|
Hi Jonathan Sorry for the delay, and thanks. Now about your questions: -- Curl: Curl by itself does seem to be faster than using php own socket functions, just because the extra effort of parsing HTTP headers that you *have* to do in raw php, altough the performance gain is almost insignificant. Recently I was performing a few tests over CURL to see if it's possible to use it in the data sending mechanism of HessianPHP. After some time messing with curl_setopt I was able to send binary data to both HessianPHP and Hessian Java, but it has some really ugly caveat. The only way I can make a Hessian service understand binary data coming from PHP is to simulate a file upload(!). Curl will accept a file descriptor (resource) for a file upload, but only it it point to a real file. I tried to simulate it using php streams ( stream_wrapper_register() ), that can act as file descriptors without being a real file, but Curl keeps reject it. So the only way was to save a *real* file with the data payload and then upload it to the remote service (think about tmpfile()). Ugly and slow of course. So I for the time being, I have given up in my efforts to use Curl, it just doesn't behave well, maybe I will try again in a later version of php or someone will give me another hint. -- Zlib compression It's a great idea and there was a discussion in Hessian mail list some time ago about how to incorporate it into the protocol. The C++ version of Hessian, HessianCPP, uses it but it does recognize gzip compressed data by looking a the first 2 or 3 of the data itself, not by a protocol standard. People has proposed several options to incorporate in into the protocol, or keep it simple and use HTTP headers to see if data needs to be decompressed. I am working in the new version of HessianPHP and I am planning to incorporate this feature as soon as possible. Check out Hessian's original mailing list for a deeper discussion: http://www.caucho.com/support/hessian-interest/ |