forked from borisRobson/onvif_rtsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtcp_handler.cpp
More file actions
38 lines (32 loc) · 761 Bytes
/
tcp_handler.cpp
File metadata and controls
38 lines (32 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "tcp_handler.h"
#include <QDebug>
tcp_listener *listener;
tcp_handler::tcp_handler(QObject* parent)
{
#ifdef IMX6
process = "node ./tcpComms/imxMain.js";
#else
process = "sudo node ./tcpComms/main.js";
#endif
listener = new tcp_listener(2, this);
}
void tcp_handler::start()
{
listener->start(QThread::LowestPriority);
}
tcp_listener::tcp_listener(int ID, QObject *parent)
{
qDebug() << "TcpThread ID: " << ID << " this thread: "<< this<< " Parent: " << parent;
}
void tcp_listener::run()
{
tcpProcess = new QProcess();
#ifdef IMX6
tcpProcess->start("node ./tcpComms/imxMain.js");
#else
tcpProcess->start("sudo node ./tcpComms/main.js");
#endif
if(!tcpProcess->waitForStarted())
return;
exec();
}