single thread serial listener and writer