Added server ping and lag monitoring to keep connections alive.