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

Method OnInit

Plugins/FreeRDP/Client/ConnectLayerQTcpSocket.cpp:91–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91int 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
126int CConnectLayerQTcpSocket::OnClean()
127{

Callers

nothing calls this directly

Calls 3

connectToHostMethod · 0.80
GetHostMethod · 0.80
GetPortMethod · 0.45

Tested by

no test coverage detected