setting readEmitter and writeEmitter