Refactor tcp reader/writer to use single listener. Fix typo in udp reader/writer.