同步,异步,阻塞和非阻塞

这是最近需要实现一个基于TCP的一个与设备通信比较复杂的协议以前没有太搞明白的问题

之后看了这些,豁然开朗

这是Qt的TCP相关讲解:

http://www.bogotobogo.com/Qt/Qt5_Asynchronous_QTcpServer_QThreadPool.php

http://blog.csdn.net/chenlong12580/article/details/7431864

http://blog.csdn.net/chenlong12580/article/details/9003139

Qt的串口通信,当然也有阻塞和非阻塞,调用waitForXX的函数就会挂起当前caller线程,那么就阻塞了。

http://blog.csdn.net/chenlong12580/article/details/8976176

http://blog.csdn.net/chenlong12580/article/details/9003139

注意:如果main函数没有进入Qt的主事件循环,那么connect函数将没有作用。

原文地址:https://www.cnblogs.com/foohack/p/4713900.html