1 | <?php |
||
11 | class SocketFirewall implements SocketFirewallInterface, NetworkComponentAwareInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var NetworkComponentInterface |
||
15 | */ |
||
16 | protected $component; |
||
17 | |||
18 | /** |
||
19 | * @var string[] |
||
20 | */ |
||
21 | protected $blacklist; |
||
22 | |||
23 | /** |
||
24 | * @param NetworkComponentAwareInterface|null $aware |
||
25 | * @param NetworkComponentInterface|null $component |
||
26 | */ |
||
27 | 18 | public function __construct(NetworkComponentAwareInterface $aware = null, NetworkComponentInterface $component = null) |
|
37 | |||
38 | /** |
||
39 | * |
||
40 | */ |
||
41 | 17 | public function __destruct() |
|
46 | |||
47 | /** |
||
48 | * @override |
||
49 | * @inheritDoc |
||
50 | */ |
||
51 | 2 | public function setComponent(NetworkComponentInterface $component = null) |
|
55 | |||
56 | /** |
||
57 | * @override |
||
58 | * @inheritDoc |
||
59 | */ |
||
60 | 3 | public function getComponent() |
|
64 | |||
65 | /** |
||
66 | * @override |
||
67 | * @inheritDoc |
||
68 | */ |
||
69 | 5 | public function blockAddress($address) |
|
75 | |||
76 | /** |
||
77 | * @override |
||
78 | * @inheritDoc |
||
79 | */ |
||
80 | 2 | public function unblockAddress($address) |
|
89 | |||
90 | /** |
||
91 | * @override |
||
92 | * @inheritDoc |
||
93 | */ |
||
94 | 2 | public function isAddressBlocked($address) |
|
98 | |||
99 | /** |
||
100 | * @override |
||
101 | * @inheritDoc |
||
102 | */ |
||
103 | 1 | public function getBlockedAddresses() |
|
107 | |||
108 | /** |
||
109 | * @override |
||
110 | * @inheritDoc |
||
111 | */ |
||
112 | 2 | public function handleConnect(NetworkConnectionInterface $conn) |
|
121 | |||
122 | /** |
||
123 | * @override |
||
124 | * @inheritDoc |
||
125 | */ |
||
126 | 2 | public function handleDisconnect(NetworkConnectionInterface $conn) |
|
133 | |||
134 | /** |
||
135 | * @override |
||
136 | * @inheritDoc |
||
137 | */ |
||
138 | 1 | public function handleMessage(NetworkConnectionInterface $conn, NetworkMessageInterface $message) |
|
142 | |||
143 | /** |
||
144 | * @override |
||
145 | * @inheritDoc |
||
146 | */ |
||
147 | 2 | public function handleError(NetworkConnectionInterface $conn, $ex) |
|
154 | } |
||
155 |