clean socket closing