Use socket "getsockname" for more reliable local address identification