Added local address resolver

Fixed local address calculation error

Fixed posix compilation