Do we need this entire pattern?  I can't figure out the reason for it.  Seems like we could just mark initialSettingsSent immediately, not keep a field for the listener, and close the connection on failure.  In other words, I think it can be 2 states instead of 3.