Added heartbeat, socket write error reporting.