• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 716 Replies
    2025 Replies
  • 331 Replies
    1928 Replies

udp query

User avatar
TADS
VIP - Donator
Posts: 44

udp query

Sat Jan 31, 2015 4:32 pm

Hi all,

I wrote a script a while back to query a game server using PHP, it has always worked untill i got my new host and they are blocking "loopback" so i am unable to use my scripts.... here is a VERY BASIC udp script to get raw data back....

Code: Select all

<?php
$fp = fsockopen("udp://myip", myport, $errno, $errstr);
if (!$fp) {
    echo "ERROR: $errno - $errstr<br />\n";
} else {
    fwrite($fp, "\n");
    echo fread($fp, 8192);
    fclose($fp);
?>
this spits out my raw data and i do stuff with it in another script, but this will not run on my host and they have said....
fopen looks to be installed from what I can see but this could be being blocked or failing for another reason other than fopen not being available. It could be that the script is performing a loop back connection and this is blocked on our server so this would need to be changed to use a different connect to do what you are trying to do.
is there another way to query this udp port to get my data from the game server?

Thanks for your time
Kev
VB.NET!

Post Reply

Return to “Help & Support”