Gestire queste cose manualmente significa produrre del codice buggato e mal funzionante il 99% delle volte.
Fai un favore a te stesso e affidati ad un framework di rete asincrono:
http://www.google.it/search?hl=it&q=...n+Google&meta=