sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
时间: 2023-10-31 10:18:01 浏览: 91
这行代码是用来创建一个TCP类型的Socket。其中,socket.AF_INET是指定Socket使用IPv4协议,socket.SOCK_STREAM是指定Socket使用TCP协议。因此,该代码创建了一个TCP Socket。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python编程实例详解-Python网络编程之socket模块实例详解](https://blog.csdn.net/weixin_37988176/article/details/109372748)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [python——Socket网络编程(详细讲解)(二)](https://blog.csdn.net/xiaofengdada/article/details/122684715)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文