-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdapter.php
More file actions
34 lines (29 loc) · 828 Bytes
/
Adapter.php
File metadata and controls
34 lines (29 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Utopia\DNS;
abstract class Adapter
{
/**
* Worker start
*
* @param callable(int $workerId): void $callback
* @phpstan-param callable(int $workerId): void $callback
*/
abstract public function onWorkerStart(callable $callback): void;
/**
* Packet handler
*
* @param callable(string $buffer, string $ip, int $port, ?int $maxResponseSize): string $callback
* @phpstan-param callable(string $buffer, string $ip, int $port, ?int $maxResponseSize):string $callback
*/
abstract public function onPacket(callable $callback): void;
/**
* Start the DNS server
*/
abstract public function start(): void;
/**
* Get the name of the adapter
*
* @return string
*/
abstract public function getName(): string;
}