Connection draining
During a deploy, the new server boots with zero connections; the old server has thousands. Killing the old server outright dumps all of them at code 1006. The graceful pattern: tell clients to reconnect (they will reach the new server), wait briefly for them to disconnect on their own, then close the rest with code 1001 ("going away"). cwkPippa's lifespan example in Track 4 lesson 5 is exactly this pattern.
Client-side message buffering
During the brief disconnect window, the client may try to send. A robust client buffers locally and flushes on reconnect. This is the Track 5 ACK pattern but local: queue when not OPEN, send on next OPEN, never lose a user-typed message because of a deploy.
Rolling deploy
Behind a load balancer with sticky sessions, take down one server at a time. Connections on that server reconnect to the remaining servers. Repeat for each server. Zero global downtime; transient per-user reconnect.