more error checking, log errors, close sockets
& log errors, etc, etc.
enable linger and keepalive on sockets