fixed a bug caused by gethostbyname() in the exchange in exchangeLower.
gethostbyname() is replaced by other function call rather than making
gethostbyname() thread-safe.