if(socket_recv ( $sock , $buf , 2045, MSG_WAITALL ) === FALSE)
{
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
die("Could not receive data: [$errorcode] $errormsg <br>");
}
echo $buf;
from the function above it doesn't show full message, so I tried to get the maximum length of variable $buf like this
socket_recv ( $sock , $buf , strlen($buf), MSG_WAITALL )
but not work. please kindly help me
thx and regards,
you should receive the response with a loop
$received;
while(socket_recv($sock, $buf, 1024, 0) >= 1)
{
$received .= $buf;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With