I cannot replicate your problem. When I shutdown TWS manually, the EReader stops properly and calls EWrapperImpl::connectionClosed() which is what is supposed to happen.
?
A 509 error is not what is expected. A 509 error means your code is trying to read on a closed socket which is a bug. By commenting out "stop()" your EReader thread has hung in an infinite wait and will never end until you force the program to stop.
?
What version TWS and API are you using? Are you on Windows or Linux?My test just now is using the latest version of TWS and latest API running on Windows.