Added include of log4cplus/loggingmacros.h
Removed dead code
Added ability to try other IP's returned by getaddrinfo