Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
<p>I was just wondering that we may be able to achieve the same thing using both of these methods i.e. CURL or Socket. Has anybody tried to compare these two on performance, and any other parameters? </p>
* Socket performs better as compared to Curl.
* Usage wise Curl is better as compared to Socket.
* If you want to connect to machines over internet on different non standard ports using Sockets you might have to deal with security issues; firewall etc.
* Hosting support might be another factor but its very minimal.
Performance Statistics - Source: http://goo.gl/3q9oZ9
I believe, both have their own advantages and disadvantages over each other. But I would suggest to user cURL.
I would recommend, you are better off using cURL because:
- It knows HTTP better than fsockopen().
- It opens its own sockets.
- It is well friend of HTTP probably.
- It has standard client to perform its actions.
Here is good compression between PHP cURL and PHP Socket: http://sysmagazine.com/posts/166633/