Ping handler with time out and reconnection
Sockets number reduced to 2