Placed the socket accepting code in doInBackground.