1 | <?php |
||
15 | class ServerSocket extends Socket |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Create a new server socket |
||
20 | * |
||
21 | * @param Endpoint $endpoint |
||
22 | * The endpoint to use |
||
23 | * |
||
24 | * @throws SocketException In case of creation of socket has failed or socket options could not be set. |
||
25 | */ |
||
26 | 1 | public function __construct(Endpoint $endpoint) |
|
34 | |||
35 | /** |
||
36 | * Creates a service at the given endpoint |
||
37 | * |
||
38 | * @throws SocketException in case of it is not possible to serve due to binding or listening error |
||
39 | */ |
||
40 | public function serve(ServiceCallback $callback) |
||
68 | |||
69 | /** |
||
70 | * Bind the server socket to the given endpoint |
||
71 | * |
||
72 | * @throws SocketException in case of binding has failed |
||
73 | */ |
||
74 | private function bind() |
||
81 | |||
82 | /** |
||
83 | * Listen to the binded socket endpoint |
||
84 | * |
||
85 | * @throws SocketException in case of listening is not possible |
||
86 | */ |
||
87 | private function listen() |
||
94 | } |
||
95 |