updated the socket handlers for logging and diag