[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: HTTPAPI TOO FAST
Sender: "Wagner, Kurt" <Kurt.Wagner@xxxxxxxxxxxxxxxx>
Here is a short wait example: (Change seconds or microns to
whatever you like)
D* CrtRpgMod MyLib/AWait MyLib/qRpgLeSrc
D* CrtPgm MyLib/AWait BndDir( Qc2LE )
D* MI Time function
D prMITime Pr ExtProc( 'mitime' )
D pipMITime * Value
D piiHrs 10I 0 Value
D piiMins 10I 0 Value
D piiSecs 10I 0 Value
D piiMSecs 10I 0 Value
D* Wait time function
D prSleep Pr ExtProc( 'waittime' )
D pipMITime * Value
D piiOption 5I 0 Value
D gaMITime S 8 Inz
D waitit C Const(x'0000')
D Seconds S 10I 0
D Microns S 10I 0
C Eval seconds = *Zero
C Eval Microns = 100
C CallP prMITime(%Addr(gaMITime)
C :0:0:seconds:Microns)
C CallP prSleep(%Addr(gaMITime)
C :waitit)
C SetOn LR
-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx
To: ftpapi@xxxxxxxxxxxxx
Sent: 12/8/2005 4:16 PM
Subject: HTTPAPI TOO FAST
HTTPAPI too fast In the response to this question
(www.scottklement.com/archives/ftpapu/200508/msg00067.html
<http://www.scottklement.com/archives/ftpapu/200508/msg00067.html> ).
Says to fix this problem add code similar to the following that runs
before you call http_url_post (or post_raw, or post_xml, or whatever)
// wait up to 5 seconds for a 100-continue response:
http_Set_100_timeout(5):
How do I do this in rpgle? Can you show me an example?
My program does the following.
C eval data = '<?xml version="1.0"' +
C ' encoding="utf-8"?>' +
C '<soap:Envelope xmlns' +
C ':xsi="http://www.w3.org' +
C '/2001/XMLSchema-instance" '+
C 'xmlns:xsd="http://www.w3.org'+
C '/2001/XMLSchema" xmlns:soap="http://' +
Etc.
Then
c eval rc = http_persist_post( comm
c : url
c : 0
c : *NULL
c : %addr(data)
c : %len(%trimr(data))
c : 1
c : %paddr('INCOMING')
c : 20
c : 'Mozilla/5.0 (X11; U; OS400)'
c : 'text/xml'
Etc.
The program sends & receives just fine, but it gets quite a few
time-outs and has to resend a lot.
It would save a lot of cycles if it did not have to do so many re-sends.
Any help would be greatly appreciated.
Steve
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------