public function __construct(InetAddress $ipAddress, $portNumber)
 {
     parent::__construct($ipAddress, $portNumber);
     $this->buffer = ByteBuffer::allocate(1400);
     $this->channel = SocketChannel::open();
     $this->remoteSocket = array($ipAddress, $portNumber);
 }
 public function testSetTimeout()
 {
     SteamSocket::setTimeout(2000);
     $steamSocketClass = new \ReflectionClass('\\SteamCondenser\\Servers\\Sockets\\SteamSocket');
     $timeoutProperty = $steamSocketClass->getProperty('timeout');
     $timeoutProperty->setAccessible(true);
     $this->assertEquals(2000, $timeoutProperty->getValue());
 }
 /**
  * Sends the given RCON packet to the server
  *
  * @param SteamPacket $dataPacket The RCON packet to send to the server
  */
 public function send(SteamPacket $dataPacket)
 {
     if (empty($this->socket) || !$this->socket->isOpen()) {
         $this->socket = new TCPSocket();
         $this->socket->connect($this->ipAddress, $this->portNumber, SteamSocket::$timeout);
     }
     parent::send($dataPacket);
 }
 public function __construct($ipAddress, $portNumber = 27015, $isHLTV = false)
 {
     parent::__construct($ipAddress, $portNumber);
     $this->isHLTV = $isHLTV;
 }
 /**
  * @param SteamPacket $requestData
  */
 private function sendRequest(SteamPacket $requestData)
 {
     $this->socket->send($requestData);
 }
 /**
  * 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;
 }
 public function __construct(InetAddress $ipAddress, $portNumber)
 {
     parent::__construct($ipAddress, $portNumber);
 }