Ensuring that sockets are closed fully after EOF.