Can currentHostAndPort be wrong here, since this function is not synchronized?  currentHostAndPort may be reset to something else by some other connection just after this thread has finished executing line 200.