socket.gaierror:[Errno 11001] getaddrinfo failed


socket.gaierror:[Errno 11001] getaddrinfo failed
學習視頻課程【TCP協議概述及Python的TCP支持與創建TCP服務端】出現的錯誤
錯誤消息:
![在這里插入圖片描述](https://upload-images.jianshu.io/upload_images/22753219-45b1c58e97d486ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
代碼:
![在這里插入圖片描述](https://upload-images.jianshu.io/upload_images/22753219-81a9aa91b7d335b4?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
找了好久的問題結果原因竟然是多了一個空格
![在這里插入圖片描述](https://upload-images.jianshu.io/upload_images/22753219-2e3a423b30b3bc94.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
刪除空格之后有了驚喜,變成這個錯誤了!!!!!!
![在這里插入圖片描述](https://upload-images.jianshu.io/upload_images/22753219-022b2a4377d8e139.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
這個問題是 端口被占用的錯誤提示
用netstat -a看到有端口占用,改了端口就沒有問題了
然后就運行正常了


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
來都來了,點個贊再走吧
點贊的都是嫖,不點贊的都是白嫖吧
微信搜索【猿的一日】IT男老司機等你上車
或掃碼加入公眾號
![在這里插入圖片描述](https://upload-images.jianshu.io/upload_images/22753219-1fc3a621a306b8de.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM