| 1 | <?php |
||
| 9 | { |
||
| 10 | |||
| 11 | protected bool $isConnected = false; |
||
|
|
|||
| 12 | protected string $schema = 'udp://'; |
||
| 13 | |||
| 14 | public function connect(string $address, array $options = []): static |
||
| 15 | { |
||
| 16 | $this->isConnected = true; |
||
| 17 | 4 | return parent::connect($address, $options); |
|
| 18 | } |
||
| 19 | 4 | ||
| 20 | 4 | public function isConnected(): bool |
|
| 21 | { |
||
| 22 | return $this->isConnected && $this->target !== null; |
||
| 23 | 4 | } |
|
| 24 | |||
| 25 | 4 | public function close(): void |
|
| 26 | { |
||
| 27 | parent::close(); |
||
| 28 | 4 | $this->isConnected = false; |
|
| 29 | } |
||
| 30 | } |
||
| 31 |