Connection check

Check if connection is up or reconnect.