| 1 | <?php |
||
| 13 | class Factory |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var NetworkInterface |
||
| 18 | */ |
||
| 19 | private $network; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var LoopInterface |
||
| 23 | */ |
||
| 24 | private $loop; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param NetworkInterface $network |
||
| 28 | * @param LoopInterface $loop |
||
| 29 | 21 | */ |
|
| 30 | public function __construct(LoopInterface $loop, NetworkInterface $network = null) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $host |
||
| 38 | * @return Dns\Resolver |
||
| 39 | 21 | */ |
|
| 40 | public function getDns($host = '8.8.8.8') |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param Random|null $random |
||
| 47 | * @return Messages\Factory |
||
| 48 | 21 | */ |
|
| 49 | public function getMessages(Random $random = null) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param string $ipAddress |
||
| 59 | * @param int $port |
||
| 60 | * @param BufferInterface|null $services |
||
| 61 | * @return NetworkAddress |
||
| 62 | 21 | */ |
|
| 63 | public function getAddress($ipAddress, $port = 8333, BufferInterface $services = null) |
||
| 71 | } |
||
| 72 |