1 | <?php |
||
20 | class UdpClientSocket implements SocketInterface, WithoutConnectionInterface |
||
21 | { |
||
22 | /** |
||
23 | * Original server socket |
||
24 | * |
||
25 | * @var SocketInterface |
||
26 | */ |
||
27 | private $origin; |
||
28 | |||
29 | /** |
||
30 | * I/O interface |
||
31 | * |
||
32 | * @var IoInterface |
||
33 | */ |
||
34 | private $ioInterface; |
||
35 | |||
36 | /** |
||
37 | * Socket context |
||
38 | * |
||
39 | * @var Context |
||
40 | */ |
||
41 | private $context; |
||
42 | |||
43 | /** |
||
44 | * UdpClientSocket constructor. |
||
45 | * |
||
46 | * @param SocketInterface $origin Original server socket |
||
47 | * @param string $remoteAddress Client address |
||
48 | * @param string $data Data for this client |
||
49 | */ |
||
50 | 11 | public function __construct(SocketInterface $origin, $remoteAddress, $data) |
|
56 | |||
57 | /** {@inheritdoc} */ |
||
58 | 3 | public function open($address, $context = null) |
|
62 | |||
63 | /** {@inheritdoc} */ |
||
64 | 1 | public function close() |
|
68 | |||
69 | /** {@inheritdoc} */ |
||
70 | 1 | public function read(FramePickerInterface $picker, $isOutOfBand = false) |
|
74 | |||
75 | /** {@inheritdoc} */ |
||
76 | 1 | public function write($data, $isOutOfBand = false) |
|
80 | |||
81 | /** {@inheritdoc} */ |
||
82 | 4 | public function getStreamResource() |
|
86 | |||
87 | /** |
||
88 | * @inheritDoc |
||
89 | */ |
||
90 | 1 | public function __toString() |
|
94 | |||
95 | /** |
||
96 | * @inheritDoc |
||
97 | */ |
||
98 | 3 | public function isServer() |
|
102 | |||
103 | /** |
||
104 | * @inheritDoc |
||
105 | */ |
||
106 | 1 | public function isClient() |
|
110 | |||
111 | /** |
||
112 | * @inheritDoc |
||
113 | */ |
||
114 | 1 | public function isConnected() |
|
118 | } |
||
119 |