Skip to content
Snippets Groups Projects
Commit 3c532fff authored by Perttu Ahola's avatar Perttu Ahola
Browse files

lol, i have apparently used python too much...

parent 90dba34d
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ Initialization:
# host: ip of server (use gethostbyname(hostname) to get from a dns name)
# port: port of server
function check_if_minetestserver_up($host, $port)
{
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$timeout = array("sec" => 1, "usec" => 0);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, $timeout);
......@@ -67,4 +68,5 @@ function check_if_minetestserver_up($host, $port)
return true;
}
return false;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment