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