MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / run

Method run

Src/SSH/SSHTunnelThread.cpp:34–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void CSSHTunnelThread::run()
35{
36 int nRet = 0;
37 qDebug(log) << "CSSHTunnelThread run";
38 CChannelSSHTunnelForward* p = new CChannelSSHTunnelForward(
39 m_pParameter, m_pRemoteNet, m_pBackend);
40 if(!p)
41 return;
42
43 do{
44 bool check = connect(p, SIGNAL(sigServer(QString, quint16)),
45 this, SIGNAL(sigServer(QString, quint16)));
46 Q_ASSERT(check);
47 check = connect(p, SIGNAL(sigServer(QString)),
48 this, SIGNAL(sigServer(QString)));
49 Q_ASSERT(check);
50 check = connect(p, SIGNAL(sigError(int,QString)), this,
51 SIGNAL(sigError(int,QString)));
52 Q_ASSERT(check);
53
54 if(!p->open(QIODevice::ReadWrite)) {
55 emit m_pBackend->sigShowMessageBox(
56 tr("Error"), p->errorString(), QMessageBox::Critical);
57 nRet = -1;
58 break;
59 }
60 while (!m_bExit && nRet >= 0) {
61 nRet = p->Process();
62 if(nRet) {
63 qCritical(log) << "Process fail" << p->errorString();
64 break;
65 }
66 }
67
68 p->close();
69 } while(0);
70
71 if(nRet)
72 emit sigError(nRet, p->errorString());
73
74 emit sigStop();
75 p->deleteLater();
76
77 qDebug(log) << "CSSHTunnelThread end";
78}

Callers

nothing calls this directly

Calls 4

errorStringMethod · 0.80
openMethod · 0.45
ProcessMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected