예제 #1
0
 /**
  * Creates a new UDP socket to communicate with the server on the given IP
  * address and port
  *
  * @param string $ipAddress Either the IP address or the DNS name of the
  *        server
  * @param int $portNumber The port the server is listening on
  */
 public function __construct($ipAddress, $portNumber = 27015)
 {
     if (!isset(self::$log)) {
         self::$log = new \Monolog\Logger('SteamSocket');
     }
     $this->socket = new UDPSocket();
     $this->socket->connect($ipAddress, $portNumber, 0);
 }
 /**
  * Sets the timeout for socket operations
  *
  * Any request that takes longer than this time will cause a {@link
  * TimeoutException}.
  *
  * @param int $timeout The amount of milliseconds before a request times
  *        out
  */
 public static function setTimeout($timeout)
 {
     self::$timeout = $timeout;
 }