I have the following code running in AsyncTask:
socket = new Socket(host, Integer.parseInt(port));
In the case when host name is correct, but there is no socket server listening on the port, this line may work several minutes before throwing exception. Can I set communication timeout? Also, is it possible to stop this process - currently it doesn't react to AsyncTask.cancel call.