]> git.vomp.tv Git - vompclient.git/blob - vdp6.h
MVP compatibility fix
[vompclient.git] / vdp6.h
1 /*
2     Copyright 2019 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef VDP_H
21 #define VDP_H
22
23 #if IPV6
24
25 #include <thread>
26 #include <vector>
27
28 class VDRServer;
29
30 /*
31  * Until VDP is reorganised, getServers must be called after stop
32  * and the buffers pointed to by the VDRServer structs must be freed
33  * by the caller.
34  */
35
36 class VDP6
37 {
38   public:
39     VDP6();
40
41     void run();
42     void stop();
43     int numFound();
44     vector<VDRServer>* getServers() { return &servers; }
45
46   private:
47     int pfds[2];
48     int sock;
49     std::thread receiveThread;
50     vector<VDRServer> servers;
51 };
52
53 #endif
54
55
56
57 #endif