blob: 75784f7a1e6c635900d9b7b08c9b03fbe3f6bd81 [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020, Regents of the University of California
*
* BSD license, See the LICENSE file for more information
*
* Author: Qiuhan Ding <qiuhanding@cs.ucla.edu>
*/
#ifndef CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP
#define CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP
#include "common.hpp"
#include <QThread>
#include <mutex>
#include <boost/thread.hpp>
#include <ndn-cxx/face.hpp>
namespace chronochat {
class NfdConnectionChecker : public QThread
{
Q_OBJECT
public:
NfdConnectionChecker(QObject* parent = nullptr);
protected:
void
run();
signals:
void
nfdConnected();
public slots:
void
shutdown();
private:
bool m_nfdConnected;
std::mutex m_nfdMutex;
unique_ptr<ndn::Face> m_face;
};
} // namespace chronochat
#endif // CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP