Error in sockets


#1

Hi folks,

I have a problem opening sockets in php (I supose in other languages too) when I open a socket.

Actually I can open the socket in port 80 doing this

$fp = fsockopen($ip_addr, 80, $errno, $errstr, 30);

No error from now.

Thus I belive I can write things to the socket, doing this call

if(fwrite ($fp, $thigs_to_write) === FALSE)
{
echo “Cannot write to soket!”;
exit;
}

And no error is displayed to me.

BUT

I cannot read thigs from the socket :frowning:

I try this:

while(!feof($fp))
{
echo ‘.’;
flush();

$response .= fgets($fp, 500);
}

but no ‘dot’ is displayed to me :frowning:

I had tries this script in a dedicated server before and it works well but here there is no way.

Maybe there is a firewall blocking this kind of things.

Help please!!!


#2

It works :slight_smile:

Just a mal formed request!!!

Sorry.