MythTV  master
portchecker.h
Go to the documentation of this file.
1 // Copyright (c) 2017 MythTV Developers <mythtv-dev@mythtv.org>
3 //
4 // This is part of MythTV (https://www.mythtv.org)
5 //
6 // This program 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 // This program 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 this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 //
24 
25 #ifndef PORTCHECKER_H_
26 #define PORTCHECKER_H_
27 
28 #include <QObject>
29 #include <QString>
30 
31 #include "mythbaseexp.h"
32 
43 class MBASE_PUBLIC PortChecker : public QObject
44 {
45  Q_OBJECT
46 
47  public:
48  PortChecker() = default;
49  ~PortChecker() = default;
50  bool checkPort(QString &host, int port, int timeLimit=30000,
51  bool linkLocalOnly=false);
52 
53  static bool resolveLinkLocal(QString &host, int port,
54  int timeLimit=30000);
55 
56  public slots:
57  void cancelPortCheck(void);
58 
59  private:
60  bool m_cancelCheck {false};
61  void processEvents(void);
62 };
63 
64 #endif
65 
66 /* vim: set expandtab tabstop=4 shiftwidth=4: */
unsigned int slots[4]
Definition: element.c:38
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
Small class to handle TCP port checking and finding link-local context.
Definition: portchecker.h:43