| 89 | } |
| 90 | |
| 91 | int CConnectLayerQTcpSocket::OnInit(rdpContext *context) |
| 92 | { |
| 93 | int nRet = 0; |
| 94 | |
| 95 | bool check = false; |
| 96 | |
| 97 | check = connect(&m_TcpSocket, SIGNAL(connected()), |
| 98 | this, SLOT(slotConnected())); |
| 99 | Q_ASSERT(check); |
| 100 | |
| 101 | check = connect(&m_TcpSocket, SIGNAL(disconnected()), |
| 102 | m_pOperate, SIGNAL(sigDisconnect())); |
| 103 | Q_ASSERT(check); |
| 104 | |
| 105 | check = connect(&m_TcpSocket, |
| 106 | #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
| 107 | SIGNAL(errorOccurred(QAbstractSocket::SocketError)), |
| 108 | #else |
| 109 | SIGNAL(error(QAbstractSocket::SocketError)), |
| 110 | #endif |
| 111 | this, SLOT(slotError(QAbstractSocket::SocketError))); |
| 112 | Q_ASSERT(check); |
| 113 | |
| 114 | m_hSocket = WSACreateEvent(); |
| 115 | if(!m_hSocket) { |
| 116 | qCritical(log) << "CreateEvent ssh socket event failed"; |
| 117 | return -1; |
| 118 | } |
| 119 | |
| 120 | auto &net = m_pParameter->m_Net; |
| 121 | m_TcpSocket.connectToHost(net.GetHost(), net.GetPort()); |
| 122 | |
| 123 | return nRet; |
| 124 | } |
| 125 | |
| 126 | int CConnectLayerQTcpSocket::OnClean() |
| 127 | { |
nothing calls this directly
no test coverage detected