ai_socktype不支持Servname [英] Servname not supported for ai_socktype

查看:1848
本文介绍了ai_socktype不支持Servname的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Vagrant运行Centos虚拟机。机器似乎运行正常,但当我尝试同步Perforce时,我可以看到以下错误:

I'm running a Centos virtual machine using Vagrant. The machine seems to run properly, but when I try to sync Perforce I can see the following error:

[vagrant@vagrant-c5-x86_64 ~]$ /perforce/p4 sync -f ...  
Perforce client error:  
Connect to server failed; check $P4PORT.  
failed.TCP connect to perforce.xxx.com:1666  
Servname not supported for ai_socktype

我已阅读此 http: //www.ducea.com/2006/09/11/error-servname-not-supported-for-ai_socktype/ 并尝试在 / etc / services ,但它不起作用。我甚至不确定问题是Perforce还是OS相关。

I have read this http://www.ducea.com/2006/09/11/error-servname-not-supported-for-ai_socktype/ and tried to set the ports in /etc/services, but it didn't work. I am not even sure if the problem is Perforce or OS related.

任何提示?

推荐答案

我在Tornado / Python应用程序中遇到此问题。显然,端口被解释为字符串而这可能会导致一个整数。所以在我的情况下,我需要更改我的启动脚本以强制它被解释为整数。

I had this problem with a Tornado/Python app. Apparently, this can be caused by the port being interpreted as a string instead of an integer. So in my case, I needed to change my startup script to force it to be interpreted as an integer.

application = tornado.web.Application(...)
application.listen(int(port))

这篇关于ai_socktype不支持Servname的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆