[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: RE : HTTPAPI



These options do not have anything to do with http. They are DNS parameters. They affect DNS lookup from the IBMi to the DNS servers listed in your configuration. So, they may affect DNS lookups but not really anything else.

You can have a time-out in http. If the server does not respond within the time specified, the communication can fail. HTTP protocol, TCP protocol, and the HTTPAPI API do not handle retries in this case.

The underlying TCP does have a capability of doing some limited retries. This is for low level communication errors (think wire level problems). See CHGTCPA.

A failed communication will not be in pending...it failed. Can you use HTTPAPI to retry? Sort of... HTTPAPI will return the error after a failed communication attempt. I took EXAMPLE1 and purposely caused a timeout (error number 7). As seen in debug...

SetError() #7: Timeout occurred while trying to connect to server!     

HTTPAPI returns a number (rc) that indicates it did not complete successfully. After that, you can obtain the exact error using http_dmsg. The code below shows retrying communications on timeout error.

c                   eval      rc = http_url_get(URL: IFS : 5)  
c                   if        rc <> 1                                
c                   eval      retries = 0                            
c                   eval      msg = http_error(errNo)                
c                   dow       errNo = 7 and retries < 5              
c                   callp     http_dmsg('rc= ' + %char(rc))          
c                   callp     http_dmsg('retries= ' + %char(retries))
c                   eval      rc = http_url_get(URL: IFS : 5)        
c                   if        rc = 1                                 
c                   eval      retries = *hival                       
c                   else                                             
c                   eval      msg = http_error(errNo)                
c                   eval      retries += 1                           
c                   endif                                            
c                   enddo                                            
c                   endif    
                                        
Then you can handle the different errors however you want. In this case, I retry a total of 5 times on a timeout.

2014-08-15-16.04.58.304000 SetError() #7: Timeout occurred while trying to connect to server! 
2014-08-15-16.04.58.304000 rc= -1                                                             
2014-08-15-16.04.58.304000 retries= 1                                                         
2014-08-15-16.04.58.304000 http_url_get(): entered                                            
2014-08-15-16.04.58.304000 http_persist_open(): entered                                       
2014-08-15-16.04.58.304000 http_long_ParseURL(): entered                                      
2014-08-15-16.04.58.305000 DNS resolver retrans: 2                                            
2014-08-15-16.04.58.305000 DNS resolver retry  : 2                                            
2014-08-15-16.04.58.305000 DNS resolver options: x'00000136'                                  
2014-08-15-16.04.58.305000 DNS default domain: MILWAUKEEVALVE.COM                             
2014-08-15-16.04.58.305000 DNS server found: 172.22.1.32                                      
2014-08-15-16.04.58.305000 DNS server found: 172.21.1.19                                      
2014-08-15-16.05.03.485000 SetError() #7: Timeout occurred while trying to connect to server! 
2014-08-15-16.05.03.485000 rc= -1                                                             
2014-08-15-16.05.03.485000 retries= 2
... etc                                                                                                                    



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Christian Murray
Sent: Friday, August 15, 2014 2:27 PM
To: HTTPAPI and FTPAPI Projects
Subject: RE : RE : HTTPAPI

Thks, I understand that these options have no effect on your HTTAPI programs, but is these options have any effect on http comm? Can a fail comm can be in pending status and be retransmit from any other way?


Christian Murray
Analyste-Programmeur Sénior

Effenti Québec
3175 chemin des Quatre-Bourgeois, bureau 150
Québec (Québec)  G1W 2K7
Tél. : (418) 781-1777  ext: 240  |  Fax : (418) 781-1780

________________________________________
De : ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] de la part de Scott Klement [sk@xxxxxxxxxxxxxxxx]
Envoyé : 15 août 2014 11:42
À : HTTPAPI and FTPAPI Projects
Objet : Re: RE : HTTPAPI

Christian,

These refer to the options you can set with the CHGTCPDMN command (or
CFGTCP option 12).

These will NOT cause HTTPAPI to retry a request to a web server, ever.
The only way HTTPAPI will re-run a request to a web server is if you
explicitly call the HTTP routine again in your calling code.

-SK


On 8/15/2014 10:30 AM, Christian Murray wrote:
> Hello Scott,
>
> Yes this is what I'm referring to... Is the DNS configuration make the transmission retry if fail ?
>
>
> Christian Murray
> Analyste-Programmeur Sénior
>
> Effenti Québec
> 3175 chemin des Quatre-Bourgeois, bureau 150
> Québec (Québec)  G1W 2K7
> Tél. : (418) 781-1777  ext: 240  |  Fax : (418) 781-1780
>
> ________________________________________
> De : ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] de la part de Scott Klement [sk@xxxxxxxxxxxxxxxx]
> Envoyé : 15 août 2014 11:17
> À : HTTPAPI and FTPAPI Projects
> Objet : Re: HTTPAPI
>
> Hello Christian,
>
> Can you explain where you are seeing these RETRY and RETRANS options?
> Are you referring to the DNS resolver options that are printed in the
> debug/trace file?   These are the only RETRY and RETRANS that I can find
> in HTTPAPI...  but it is just logging options that are set in your DNS
> configuration, it is not (directly) related to HTTP.
>
> Is that what you're referring to?  Or can you provide more information?
>
> -SK
>
> On 8/15/2014 9:57 AM, Christian Murray wrote:
>>      Hi Scott,
>>      First, big thanks for all you've done for our community.
>>      I would like to know what is RETRY and RETRANS parms are for and where
>>      I can change there values.
>>      What happen if broken link happens during a transmission? Does it RETRY
>>      or RETRANSmit? What would be the best thing to do if I only want to
>>      call the web services once no matter of what happen?
>>      Tks for your help...
>>      Rgds,
>>      Christian Murray
>>      Analyste-Programmeur Sénior
>>
>>      Effenti Québec
>>      3175 chemin des Quatre-Bourgeois, bureau 150
>>      Québec (Québec)  G1W 2K7
>>      Tél. : (418) 781-1777  ext: 240  |  Fax : (418) 781-1780
>>
>>
>>
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------