Close sockets early to avoid running out of file handles.
Uncomment connection problem logging on removal of defunct connections.
Added demo-flow related comments.