rendered paste body<?php
echo "connecting without ssl\n";
$sock = fsockopen("euserv.de", 80,$errno, $errstr, 30);
if($sock) echo "connected;\n";
socket_set_blocking($sock, 0);
$count=0;
while (!feof($sock))
{
echo "loop: ".$count."\n";
fgets($sock, 4096);
if($count==10) break;
$count++;
}
fclose($sock);
unset($sock);
if($count==10) echo "stream_set_blocking(\$sock, 0); seems to work without ssl!\n"; else echo "it is not working :(\n";
//now with ssl:
echo "connecting with ssl\n";
$sock = fsockopen("ssl://euserv.de", 443,$errno, $errstr, 30);
stream_set_blocking($sock, 0);
$count=0;
while (!feof($sock))
{
echo "loop: ".$count."\n";
fgets($sock, 4096);
if($count==10) break;
$count++;
}
fclose($sock);
unset($sock);
if($count==10) echo "stream_set_blocking(\$sock, 0); seems to work with ssl!\n"; else echo "it is not working :(\n";
?>