When a client closed its connection, handleConnection threw on the
null line, closed the socket, and then logged socket.description() -
which reads the address of the now-closed socket and throws
ClosedChannelException. That escaped the handler and crashed the
whole server, dropping every other client's connection. With the
Docker syslog log driver in non-blocking mode, the Factorio server's
logs were then silently discarded, so most packets never arrived.
Treat a null line as a normal client disconnect, capture the socket
description while it's still open, and always close the socket in
'finally', so one connection can't take down the server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>