Persisting sockets and closing datagrams on close.