Sounds reasonable to me. I'm not sure I understand the need to
disconnect though. What is the issue that occurs if you don't
disconnect?
Just that the server doesn't notice the client is gone until the TCP
keepalive probes time the connection out. It shouldn't be a major issue,
but on resource-strapped servers that serve hundreds of clients, it
might be better to avoid it if possible. Also, it's just cleaner to
properly disconnect if we know we're going down anyway, and I don't see
any downside to doing this (but then, I could be missing something).