Enhance socket connection handling;

Add ping, respond to ping with pong and log connection errors.