I wonder if there's a way to use curl
trhough an already open socket, something like, adapting this:
<?php
$fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
to use curl_exec()
instead of fgets($fp, 128)
(or, any other way to use curl()
over the same stream all the time, my goal is to read the twitter stream api)
Thank you