1 | <?php |
||
17 | class AcceptedFrame implements FrameInterface |
||
18 | { |
||
19 | /** |
||
20 | * Client address, if available |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $clientAddress; |
||
25 | |||
26 | /** |
||
27 | * Connected client socket |
||
28 | * |
||
29 | * @var SocketInterface |
||
30 | */ |
||
31 | private $socket; |
||
32 | |||
33 | /** |
||
34 | * AcceptResponse constructor. |
||
35 | * |
||
36 | * @param string $clientAddress Remote client address |
||
37 | * @param SocketInterface $socket Remote socket |
||
38 | */ |
||
39 | 5 | public function __construct($clientAddress, SocketInterface $socket) |
|
40 | { |
||
41 | 5 | $this->clientAddress = $clientAddress; |
|
42 | 5 | $this->socket = $socket; |
|
43 | 5 | } |
|
44 | |||
45 | /** {@inheritdoc} */ |
||
46 | 1 | public function getData() |
|
50 | |||
51 | /** {@inheritdoc} */ |
||
52 | 5 | public function __toString() |
|
56 | |||
57 | /** |
||
58 | * Return client socket |
||
59 | * |
||
60 | * @return SocketInterface |
||
61 | */ |
||
62 | 5 | public function getClientSocket() |
|
66 | |||
67 | /** {@inheritdoc} */ |
||
68 | 7 | public function getRemoteAddress() |
|
72 | } |
||
73 |