Skip to content

Instantly share code, notes, and snippets.

@koraktor
Created December 30, 2010 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koraktor/759593 to your computer and use it in GitHub Desktop.
Save koraktor/759593 to your computer and use it in GitHub Desktop.
Customizing socket timeouts in Steam Condenser (>= 0.12.0)
<?php
require_once 'steam-condenser.php';
// Setting the timeout to 50ms (default is 1000ms / 1s)
SteamSocket::setTimeout(50);
// Query a local server which should respond quite fast
$server = new SourceServer(new InetAddress('192.168.0.5'));
$server->getRules();
// Setting the timeout to 2000ms
SteamSocket::setTimeout(2000);
// Query a server somewhere in the internet, it may be slow
$server = new SourceServer(new InetAddress('server.far.away'));
$server->getRules();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment