Ver Mensaje Individual
  #1  
Antiguo 27-10-2014
petete2008 petete2008 is offline
Miembro
 
Registrado: oct 2008
Posts: 109
Reputación: 16
petete2008 Va por buen camino
método post error timeout

Hola , tengo el siguiente codigo

Código:
function PostExample: string; 
var   lHTTP: TIdHTTP;   lParamList: TStringList; 
begin   lParamList := TStringList.Create;   
lParamList.Add('id=1');    
lHTTP := TIdHTTP.Create(nil);   
try     
Result := lHTTP.Post('http://blahblahblah...', lParamList);   
finally    
 lHTTP.Free;    
 lParamList.Free;  
 end; 
end;
Mi problema es que a veces funciona y otras veces. Las veces que no funciona me devuelve el siguiente mensaje :

Error encountered during POST: Socket Error #10060
Connection time out

Mi pregunta es si sería posible de una forma sencilla hacer que lo vuelva a reintentar pasado por ejemplo 10 segundos y así sucesivamente con 10 intentos por ejemplos.
Y pasado todo esto si sigue devolviendo error entonces mostrar un error y salir del programa.

Gracias.
Responder Con Cita