set socket option SO_RCVTIMEO
set socket option SO_RCVTIMEO

Added socket option SO_RCVTIMEO, this shortened timeouts in my application to reasonable periods when querying non-responsive Minecraft servers. 
PMPlugins/PHP-Minecraft-Query,xPaw/PHP-Minecraft-Query