You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "mivanac (GitHub)" <gi...@apache.org> on 2019/09/15 21:59:03 UTC

[GitHub] [geode-native] mivanac opened pull request #521: GEODE-7209: Modify check if hostname is resolved


[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] pivotal-jbarrett commented on pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "pivotal-jbarrett (GitHub)" <gi...@apache.org>.
Ok, cool. Maybe put a comment in the source since unless you look at the ACE source this would not be intuitive. 
`// ACE will not initialize port if hostname is not resolved.`

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] mivanac commented on pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "mivanac (GitHub)" <gi...@apache.org>.
According to ACE_INET_Addr implementation we can not get reply if hostname is not resolved (just error printout):
```
// Creates a ACE_INET_Addr from a PORT_NUMBER and the remote
// HOST_NAME.

ACE_INET_Addr::ACE_INET_Addr (u_short port_number,
                              const char host_name[],
                              int address_family)
  : ACE_Addr (determine_type (), sizeof (inet_addr_))
{
  ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
  ACE_OS::memset (&this->inet_addr_, 0, sizeof (this->inet_addr_));

  if (this->set (port_number,
                 host_name,
                 1,
                 address_family) == -1)
    ACELIB_ERROR ((LM_ERROR,
                ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr: %p\n"),
                ACE_TEXT_CHAR_TO_TCHAR ((host_name == 0) ?
                                        "<unknown>" : host_name)));

}
```

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] mivanac commented on pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "mivanac (GitHub)" <gi...@apache.org>.
So with deeper investigation I learned, that in  function
```
// Initializes a ACE_INET_Addr from a PORT_NUMBER and the remote
// HOST_NAME.

int
ACE_INET_Addr::set (u_short port_number,
                    const char host_name[],
                    int encode,
                    int address_family)
```
port will be set only in case hostname is resolved (there is no error).
So this is the reason why port is checked.

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] pdxcodemonkey closed pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "pdxcodemonkey (GitHub)" <gi...@apache.org>.
[ pull request closed by pdxcodemonkey ]

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] mivanac commented on pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "mivanac (GitHub)" <gi...@apache.org>.
Thanks for comment.

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode-native] pivotal-jbarrett commented on pull request #521: GEODE-7209: Modify check if hostname is resolved

Posted by "pivotal-jbarrett (GitHub)" <gi...@apache.org>.
How does this assert that the hostname is known?

[ Full content available at: https://github.com/apache/geode-native/pull/521 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org