Exemple #1
0
 /**
  * @depends testSupportsIpv6
  */
 public function testCreateIcmp6()
 {
     try {
         $socket = $this->factory->createIcmp6();
     } catch (Exception $e) {
         if ($e->getCode() === SOCKET_EPERM) {
             // skip if not root
             return $this->markTestSkipped('No access to ICMPv4 socket (only root can do so)');
         }
         throw $e;
     }
     $this->assertInstanceOf('Socket\\React\\Datagram\\Socket', $socket);
 }
Exemple #2
0
 /**
  * Create a new RconConnection
  *
  * @param $host
  * @param $port
  * @param $password
  *
  * @return \gries\Rcon\Connection
  */
 public static function create($host, $port, $password)
 {
     $factory = new \Socket\Raw\Factory();
     $socket = $factory->createClient(sprintf('%s:%s', $host, $port));
     return new \gries\Rcon\Connection($socket, $password);
 }