I want to get an object "MyObject" via GPRS / WebService from a server
to my PDA.
(with asynchronous web-Method)
This works fine, until the connection is lost due to poor reception:
The try-catch is ignored and the entire c#-program crashes !
Is there a solution for this ?
Thanks a lot for any advice.
try
{
iAsyncResult = webService.BeginWebMethod();
}
catch(System.Exception ex)
{
// error handling...
}
while (i < 50) // > 5 sec --> Timeout
{
if (iAsyncResult.IsCompleted) { break; }
Thread.Sleep(100);
i++;
}
if (i > 50)
{
MessageBox.Show("Timeout !!");
}
else
{
MyObject = webService.EndWebMethod()