On 12-12-2011 00:10:33 +0200, Charalampos Nikolaou wrote:
Hi,
just used getnameinfo() instead of gethostbyaddr() in openConnectionTCP() and it doesn't gain any time improvement. In addition, inspecting openConnectionUDP(), I saw that it uses getnameinfo() instead of gethostbyaddr() and it is slow as well. What I found, though, is that the trouble is caused by INADDR_ANY (i.e., 0.0.0.0). If 127.0.0.1 or a specific, external ip is given, then both getnameinfo() and gethostbyaddr() return instantaneously. After all, is there any point of resolving 0.0.0.0? Anyway, regardless the ip given, I think that resolving should be done in a timely manner, don't you think. Time permitting, I shall further inspect the problem to find out whether it is an issue in glibc or specific to system configuration (of Ubuntu).
Perhaps it's a firewall configuration that doesn't like the broadcast interface, and/or broadcasting packets at all.