cURL Vs Socket

This is a discussion on cURL Vs Socket within the PHP Language forums, part of the PHP Programming Forums category; hi all, I need to POST values from PHP ie through code to a page on the net. AFAIK there ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-15-2005
Vish
 
Posts: n/a
Default cURL Vs Socket

hi all,

I need to POST values from PHP ie through code to a page on the net.
AFAIK there seems to be two methods of doing so, first you can use CURL
[ curl_exec() ] and secondly open a socket [ fsockopen() ].

So guys, in terms of performance what method would be best to use? Or
what are the pros n cons of using these methods.

TIA
Vish

Reply With Quote
  #2 (permalink)  
Old 06-15-2005
Alvaro G Vicario
 
Posts: n/a
Default Re: cURL Vs Socket

*** Vish wrote/escribió (15 Jun 2005 01:27:40 -0700):
> So guys, in terms of performance what method would be best to use? Or
> what are the pros n cons of using these methods.


It'd be surprising that posting data through the Internet you faced any
performance issue related to choosing either method. 99,9% of your
performance will depend on network and remote server.

Use sockets if portability is a great issue and curl if you don't want to
reinvent the wheel.


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Reply With Quote
  #3 (permalink)  
Old 06-16-2005
Manuel Lemos
 
Posts: n/a
Default Re: cURL Vs Socket

Hello,

on 06/15/2005 05:27 AM Vish said the following:
> hi all,
>
> I need to POST values from PHP ie through code to a page on the net.
> AFAIK there seems to be two methods of doing so, first you can use CURL
> [ curl_exec() ] and secondly open a socket [ fsockopen() ].
>
> So guys, in terms of performance what method would be best to use? Or
> what are the pros n cons of using these methods.


Using socket connections is preferred not because performance reasons
but because cUrl library has problems dealing with certain kinds of servers.

You may want to take a look at this HTTP client class that can submits
and processes HTTP requests correctly. It can use the cURL library
transparently only for SSL requests, but if fsockopen supports SSL it
will be used instead of curl.

http://www.phpclasses.org/httpclient


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:31 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0