Skip to content

Commit

Permalink
TCP6 Check
Browse files Browse the repository at this point in the history
  • Loading branch information
svilborg committed Jul 16, 2019
1 parent efca7ef commit d74d0be
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Checks/Network/Tcp6.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace Health\Checks\Network;

use Health\Checks\HealthCheckInterface;

class Tcp6 extends Socket implements HealthCheckInterface
{

/**
*
* {@inheritdoc}
* @see \Health\Checks\HealthCheckInterface::call()
*/
public function call()
{
$builder = $this->getBuilder();

$address = $this->params['address'] ?? '';

$this->create(AF_INET6, SOCK_STREAM, SOL_TCP);

if (! $this->connect($address)) {
$builder->down()->withData('error', $this->getError());
}

$this->close();

return $builder->build();
}
}

0 comments on commit d74d0be

Please sign in to comment.