Ruby或Rails是否有一个名为getaddrinfo的函数?

时间:2022-05-23 12:00:45

Does Ruby or Rails have a function named getaddrinfo?

Ruby或Rails是否有一个名为getaddrinfo的函数?

If so, where is its source found?

如果是这样,它的来源在哪里?

3 个解决方案

#1


8  

getaddrinfo is part of the Socket class.

getaddrinfo是Socket类的一部分。

http://ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M003737

#2


5  

As the other answers have said, getaddrinfo is part of the Socket class.

正如其他答案所说,getaddrinfo是Socket类的一部分。

The error you're seeing happens when your Domain Name Service (AKA "DNS") resolver on your machine can not find the host you've asked it to find.

当您的计算机上的域名服务(AKA“DNS”)解析程序找不到您要求它找到的主机时,您所看到的错误就会发生。

That can happen for multiple reasons. I've had it happen when the name I'm looking for is spelled wrong, when the DNS is down, when the DNS is wrong/misconfigured.

这可能由于多种原因而发生。当我正在寻找的名称拼写错误,当DNS关闭,DNS错误/配置错误时,我已经遇到过这种情况。

You can try triangulating the problem by dropping to the command-line and typing one or more of:

您可以尝试通过删除命令行并键入以下一个或多个来对问题进行三角测量:

host name_of_the_host
dig name_of_the_host
whois name_of_the_host

Alternately, you can use the "Network Utility" if you're on a Mac, and use the "Lookup" tab. If any of those solutions respond with a successful hit then you have a problem in your Ruby setup, but it's very likely you'll get a similar response from those tools. In that case it's pointing to the problem being upstream from your computer, in whatever box your computer gets its name resolution from. Or, again, that the host you're requesting isn't actually known by that name.

或者,如果您使用的是Mac,则可以使用“网络实用程序”,并使用“查找”选项卡。如果这些解决方案中的任何一个成功响应,那么您在Ruby设置中遇到问题,但很可能您会从这些工具中获得类似的响应。在这种情况下,它指向计算机上游的问题,即计算机获取其名称解析的任何框。或者,同样,您要求的主机实际上并不知道该名称。

Mail can do that when the mail-relay information isn't correct. Once mail leaves that machine you usually won't get a notice unless the message can't be forwarded, but that takes a while to time out and bounce back.

邮件中继信息不正确时,邮件可以这样做。一旦邮件离开该机器,您通常不会收到通知,除非该邮件无法转发,但这需要一段时间才能超时并反弹。

#3


2  

getaddrinfo() is a part of the POSIX standard API, see http://en.wikipedia.org/wiki/Getaddrinfo

getaddrinfo()是POSIX标准API的一部分,请参阅http://en.wikipedia.org/wiki/Getaddrinfo

#1


8  

getaddrinfo is part of the Socket class.

getaddrinfo是Socket类的一部分。

http://ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M003737

#2


5  

As the other answers have said, getaddrinfo is part of the Socket class.

正如其他答案所说,getaddrinfo是Socket类的一部分。

The error you're seeing happens when your Domain Name Service (AKA "DNS") resolver on your machine can not find the host you've asked it to find.

当您的计算机上的域名服务(AKA“DNS”)解析程序找不到您要求它找到的主机时,您所看到的错误就会发生。

That can happen for multiple reasons. I've had it happen when the name I'm looking for is spelled wrong, when the DNS is down, when the DNS is wrong/misconfigured.

这可能由于多种原因而发生。当我正在寻找的名称拼写错误,当DNS关闭,DNS错误/配置错误时,我已经遇到过这种情况。

You can try triangulating the problem by dropping to the command-line and typing one or more of:

您可以尝试通过删除命令行并键入以下一个或多个来对问题进行三角测量:

host name_of_the_host
dig name_of_the_host
whois name_of_the_host

Alternately, you can use the "Network Utility" if you're on a Mac, and use the "Lookup" tab. If any of those solutions respond with a successful hit then you have a problem in your Ruby setup, but it's very likely you'll get a similar response from those tools. In that case it's pointing to the problem being upstream from your computer, in whatever box your computer gets its name resolution from. Or, again, that the host you're requesting isn't actually known by that name.

或者,如果您使用的是Mac,则可以使用“网络实用程序”,并使用“查找”选项卡。如果这些解决方案中的任何一个成功响应,那么您在Ruby设置中遇到问题,但很可能您会从这些工具中获得类似的响应。在这种情况下,它指向计算机上游的问题,即计算机获取其名称解析的任何框。或者,同样,您要求的主机实际上并不知道该名称。

Mail can do that when the mail-relay information isn't correct. Once mail leaves that machine you usually won't get a notice unless the message can't be forwarded, but that takes a while to time out and bounce back.

邮件中继信息不正确时,邮件可以这样做。一旦邮件离开该机器,您通常不会收到通知,除非该邮件无法转发,但这需要一段时间才能超时并反弹。

#3


2  

getaddrinfo() is a part of the POSIX standard API, see http://en.wikipedia.org/wiki/Getaddrinfo

getaddrinfo()是POSIX标准API的一部分,请参阅http://en.wikipedia.org/wiki/Getaddrinfo