Client should emit 'close' even only if it wasnt already ended