socket编程阻塞和非阻塞
时间: 2023-10-14 22:01:32 浏览: 103
socket阻塞与非阻塞
在socket编程中,阻塞和非阻塞是两种不同的工作模式。阻塞模式是指当进行网络通信时,如果没有接收到数据或者无法立即发送数据,该线程将会被阻塞,直到有数据可读或者数据可以发送。而非阻塞模式则是在进行网络通信时,如果没有数据可读或者无法立即发送数据,该线程将立即返回,不会阻塞当前线程的执行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [网络编程:socket的阻塞模式和非阻塞模式](https://blog.csdn.net/m0_56257585/article/details/126568161)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [socket阻塞与非阻塞,同步与异步、I/O模型](https://blog.csdn.net/wangweitingaabbcc/article/details/8647479)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文