Prova a fare una request ad un sito "affidabile" (tipo google), settando il timeout con un valore opportuno. Se google non ti risponde entro (ad esempio) 5 secondi probabilmente è perché il computer non è online.