Hello all!
I need some help with sockets. I have this code:
$Connection = fsockopen( "google.com ", 80, $ErrNo, $ErrStr, 30 );
if($Connection) {
echo "Connection established\n";
while(!feof($Co nnection)){
echo fgets($Connecti on, 128);
}
echo "Got some data\n";
} else {
echo "Error $ErrNo: $ErrStr\n";
}
But it never gets to output anything, it only prints "Connection
established" and then the script simply gets stuck, it never gets to
say "Got some data"...
Any help will be very appreciated.
Thanks,
Artemiy.
I need some help with sockets. I have this code:
$Connection = fsockopen( "google.com ", 80, $ErrNo, $ErrStr, 30 );
if($Connection) {
echo "Connection established\n";
while(!feof($Co nnection)){
echo fgets($Connecti on, 128);
}
echo "Got some data\n";
} else {
echo "Error $ErrNo: $ErrStr\n";
}
But it never gets to output anything, it only prints "Connection
established" and then the script simply gets stuck, it never gets to
say "Got some data"...
Any help will be very appreciated.
Thanks,
Artemiy.
Comment