CXX-11 avoid using Listener class in order to avoid race
CXX-11 add windows headers, use ifdef for platforms