解决QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
·
不要在新创建的线程中使用另一个线程的socket发送数据,需要新建一个socket来发送数据。
例如在主线程中:m_Client = new MyClient();在新开的线程:std::thread sendThread(&socketTest::sendThreadProc, this);sendThreadProc里面不要使用m_Client发送数据,而是再创建一个MyClient对象来发送数据。
更多推荐

所有评论(0)