I got this error Running my APP.

12002 ERROR_INTERNET_TIMEOUT
The request has timed out.

The App does the following:
Read a picture
Connect to a remote server
Copy the picture there

But if for any reason i can not connect to the server i got the error above.
Does anyone know how do i can control this error or the time the APP try to re-connect (almost 5 minutes)