(keitai-l) Re: time outs on doja http connections

From: Mathieu Castelli <mathieu_at_newtgames.com>
Date: 12/22/04
Message-ID: <41C93EC7.9080009@newtgames.com>
I'm afraid this won't be of much help, yet since you wrote

>I wondered if anybody had had any experience of implementing timeout 
>handling, knew the timeout settings for some of the different handsets, 
>or could point out something I am missing.
>  
>
I'm posting this (what we're using so that our users don't have to press 
'retry' unless it really won't get through) :


<code>
int count_error = 0;
try {
    //some code with [hasardous] connections
count_error = 0;
} catch (Exception e) {
    if (count_error == 5) {
        count_error = 0;
        //ERROR !!
    }
    else {
    //counts 5 errors (retries 5 times)
    // before actually declare an error
        count_error++;
        System.out.println("Request to server failed: retrying("
                    + count_error + ")");
        try { Thread.sleep(500); } catch (Exception err) { }
        //shoot again
    }
}
</code>
Received on Wed Dec 22 11:31:42 2004