1 | <?php |
||
12 | class Factory |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @var NetworkInterface |
||
17 | */ |
||
18 | private $network; |
||
19 | |||
20 | /** |
||
21 | * @var LoopInterface |
||
22 | */ |
||
23 | private $loop; |
||
24 | |||
25 | /** |
||
26 | * @param NetworkInterface $network |
||
27 | * @param LoopInterface $loop |
||
28 | */ |
||
29 | 9 | public function __construct(LoopInterface $loop, NetworkInterface $network = null) |
|
30 | { |
||
31 | 9 | $this->loop = $loop; |
|
32 | 9 | $this->network = $network ?: Bitcoin::getNetwork(); |
|
33 | 9 | } |
|
34 | |||
35 | /** |
||
36 | * @param string $host |
||
37 | * @return Dns\Resolver |
||
38 | */ |
||
39 | 9 | public function getDns($host = '8.8.8.8') |
|
43 | |||
44 | /** |
||
45 | * @param Random|null $random |
||
46 | * @return Messages\Factory |
||
47 | */ |
||
48 | 3 | public function getMessages(Random $random = null) |
|
55 | |||
56 | /** |
||
57 | * @param IpInterface $ipAddress |
||
58 | * @param int $port |
||
59 | * @param int $services |
||
60 | * @return NetworkAddress |
||
61 | */ |
||
62 | public function getAddress(IpInterface $ipAddress, $port = 8333, $services = Services::NONE) |
||
70 | } |
||
71 |