fix ip hostname differ port number error, now port number can be zero.