Ping messages and automatically reconnecting