Adding threading fixes to listeners.
Adding TCPMasterTest example