All pastes #838624 Raw Edit

Untitled

public php v1 · immutable
#838624 ·published 2007-12-30 15:10 UTC
rendered paste body
<?php// IP address$ServerIP = "127.0.0.1";// Server port$ServerPort = "27016";// Create the variables of the info command to send to the server.$ServerinfoCommand = "\377\377\377\377infostring\0";// Open a connection to the server$fp = @fsockopen("udp://".$ServerIP, $ServerPort, $errno, $errstr);//Send the request to the server.@fwrite($fp, $ServerinfoCommand);//Remove the junk headers sent back$JunkHead = fread($fp,1);// Check to see if the server is running$CheckStatus = @socket_get_status($fp);if($CheckStatus["unread_bytes"] == 0){    die("Unable to connect to the server, ensure the IP and port is correct and that the server is running.");}