support for socket closing