android-developers
[Arriba] [Todas las Listas]

[android-developers] Prácticas mejores para URLConnection - timeouts, r

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] Prácticas mejores para URLConnection - timeouts, retries.
From: Nathan <nathan.d.mellor@xxxxxxxxx>
Date: Tue, 1 Aug 2017 11:48:07 -0700 (PDT)
Delivery-date: Tue, 01 Aug 2017 14:49:16 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=42NA1M2aNkI28AUQtC4+V9dtYZkuA2iilwS5yJAEjyY=; b=eLE+FwnXtMQ8fNZ6Qjhv53kfeR3h5FMjacVFcThioIDRew/jCJHH7k/TR/zv7ScwF9 W98htweL3CW/pGPi1F/BEONOBIm5WJyMoRI7Mn1oldHCrW7ucN1s7DLir7ngIgePGIMd MtGqqu/ArcVTD6KEoXwB9nHznYC62zT/zfKj8xBQQ3mcR2jd9p7RPWY3hIpweDNAu08U s+ZWihGTqyacM3OMJWsUzvWdlxzzUF5qB/r/6BhmFEdDwnvR3oFhclmy5SRIA7HV4zFW lcaVWzKoSNPet3ynSQrRdM7jNu7sAf0X/PS4TbwGWIAKSK0tTiJZDMnmgietSGwmEl5L mfAg==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=42NA1M2aNkI28AUQtC4+V9dtYZkuA2iilwS5yJAEjyY=; b=WEI7kHDqbDRI+HfF5+p1DtqzdYkrjlGuVlmyfDaNQNRpLfDVueyeoludf+YOdS9gJD GYm/8gnZt93ak/ZXJcMtttidNmdpUTPbjnk/OaGYbkQFX/5HTDr9xwPjtgjDqy/G/nvl aL+MqT6pZDbzQQVExlK4+Eo5G2Sy2nfNnQyX/R40p21drMV5rpMvQEd74G7PFeLwGjZN u0PTCNl0wm1HcrEpaRH4EOfMMtA5QKUOhD38V0hiSYWJMjCyksr6DHl/wdE+IPUtUMts ojE6/1RCGlzUkJDNK53B+nqWyx+ppdHKJc54ySlC6zhVOWaJyRHHzyK29DM5FVcmGZqx PRQQ==
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <https://groups.google.com/group/android-developer>
List-help: <https://groups.google.com/support/>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <https://groups.google.com/group/android-developers/post>, <mailto:android-developers@googlegroups.com>
List-subscribe: <https://groups.google.com/group/android-developers/subscribe>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+364598216046+unsubscribe@googlegroups.com>, <https://groups.google.com/group/android-developers/subscribe>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
No creo que *UrlConnection es *behaving *optimally. 

Qué es las prácticas mejores para uso de *timeouts y *retries? 

el IE
Corto *timeout pero muchos *retries. 
Largo *timeout - ningún *retries
Corto *Timeout, entonces *retry con más largo *timeout. 
Algunos números reales para empezar con. 
Si *readtimeout y *connecttimeout tendría que ser diferente. 

*Etc. 

Puedes ser tentado para decir"bien, que depende en vuestro caso de uso y qué rápido 
vuestro *server *responds."

No tengo ningún control sobre el *servers o donde los usuarios de fin #acceder de, 
así que suponer "por todas partes el mapa".

En cuanto a caso de uso, estoy descargando muchos archivos pequeños (*ie 20*k) utilizando un 
*threadpool. 

Largo *timeouts ligará arriba del *threadpool si el descargar justo está yendo para 
fallar en todo caso. 

Encontré esto de *Tim *Bray.
*https://Www.tbray.org/actual/Cuando/201*x/2012/01/17/*HttpURLConnection

Pero el código de ejemplo de vida real él *referred a es no más largo allí. 

Nathan

-- 
recibiste este mensaje porque eres *subscribed al *Google Grupos "*Android *Developers" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx.
Visita este grupo en *https://grupos.*google.*com/Grupo/*android-*developers.
Para ver esta discusión en la visita de web *https://grupos.*google.*com/*d/*msgid/*android-*developers/6*f7*b951un-30*c3-4*e4*d-*bfdf-*d9#uno32061659*f%40*googlegroups.*com.
Para más opciones, visita *https://grupos.*google.*com/*d/*optout.
I do not believe that UrlConnection is behaving optimally. 

What are the best practices for use of timeouts and retries? 

IE
Short timeout but many retries. 
Long timeout - no retries
Short Timeout, then retry with longer timeout. 
Some actual numbers to start with. 
Whether readtimeout and connecttimeout should be different. 

Etc. 

You may be tempted to say"well, that depends on your use case and how fast 
your server responds."

I have no control over the servers or where the end users access them from, 
so assume "all over the map".

As for use case, I am downloading lots of small files (ie 20k) using a 
threadpool. 

Long timeouts will tie up the threadpool if the download is just going to 
fail anyway. 

I found this from Tim Bray.
https://www.tbray.org/ongoing/When/201x/2012/01/17/HttpURLConnection

But the real life example code he referred to is no longer there. 

Nathan

-- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/6f7b951a-30c3-4e4d-bfdf-d9a32061659f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>
  • [android-developers] Prácticas mejores para URLConnection - timeouts, retries., Nathan <=