login about faq

Sorry for the email Matt I'd completely forgotten about this forum !

Just trying this AbortCheck call back again and it is working however the HeartbeatMs is having no effect unless I ham misunderstanding the use

Here is the simple class from my VDF code. See comment

Thanks in advance

Andrew

Class cGovTalkHTTP is a cComChilkatHttp

Procedure End_Construct_Object
    Forward Send End_Construct_Object
    Boolean bOK
    Get ComUnlockComponent UNLOCK_CHILKAT_HTTP to bOK
    //Set ComHeartbeatMs to 5432
    Set ComHeartbeatMs to 65432
End_Procedure

Procedure OnComAbortCheck Integer ByRef llabort
    Integer i
    Get ComHeartbeatMs to I  // I shows the value I have set above BUT  OnComAbortCheck is called way more than every 5 seconds or 65 seconds...Like several times a second. Infact it is still called even if I don’t set HeatbeatMs
End_Procedure

End_Class

asked Feb 27 '13 at 05:42

CDS's gravatar image

CDS
169912


Andrew,

The HeartbeatMs property, which is common to any object/class that has an AbortCheck event callback, indicates the frequency of the AbortCheck callbacks. If set to 0 (the default), then no AbortCheck callbacks will happen. If set to 10, for example, then AbortCheck callbacks will happen approximately every 10 milliseconds. Your code is setting the HeartbeatMs property equal to 65432, which means that AbortCheck will be called very 65.432 seconds..

link

answered Feb 27 '13 at 09:19

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Hi Matt

Yes this is what I was expecting from your documentation but not what i'm seeing.

Basically the setting of HeartbeatMs is having NO effect at all and the AbortCheck is called many times a second ... even when I set it to zero

Thanks

link

answered Feb 27 '13 at 09:24

CDS's gravatar image

CDS
169912

OK, thanks! I'll investigate, but even if I find the source of the problem, at the current moment it's not possible to produce a new build due to other unrelated internal code refactoring/maintenance that is in progress. I checked for your email but did not see it. Please send another so that I can respond once I have an update.

(Feb 27 '13 at 09:33) chilkat ♦♦

Thanks Matt

Just resent a copy with same subj as this thread to cknotes address

link

answered Feb 27 '13 at 09:57

CDS's gravatar image

CDS
169912

Thanks Andrew. I see it, but the cknotes.com email address isn't checked regularly. The best email address is support@chilkatsoft.com (no need to re-send)

(Feb 27 '13 at 10:05) chilkat ♦♦

OK. I sent it there because your last reply came from admin@cknotes.com

(Feb 27 '13 at 10:41) CDS

You posted some code, but it does not actually show what method you are calling. For example, are you calling the Download method? Is it SynchronousRequest? Which of the many methods that send an HTTP request are you calling? That's the code I would need to see.

link

answered Mar 12 '13 at 20:21

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Hi Matt

Hopefully this contains all the code snips you need to see ...

Class cHTTP is a cComChilkatHttp

Procedure Construct_Object
    Forward Send Construct_Object
End_Procedure

Procedure End_Construct_Object
    Forward Send End_Construct_Object
    Boolean bOK
    Get ComUnlockComponent UNLOCK_CHILKAT_HTTP to bOK
    Set ComHeartbeatMs to 65432
End_Procedure

Procedure OnComAbortCheck Integer ByRef llabort
    // hook so you can update "we are still going" status
    Send OnAbortCheckCallback 
End_Procedure

End_Class


Object oHTTP is a cHTTP
End_Object

Object oHTTPResponse is a cComChilkatHttpResponse
End_Object

Function GatewayCall String ByRef sLastErrorText Returns Integer
    Integer iSuccess iStatusCode 
    Boolean bOK
    Variant vResponse

    Get ComUnlockComponent  of oHTTP UNLOCK_CHILKAT_HTTP to bOK

    If (bOK) Begin 
        Get ComPostXml of oHTTP (psServiceURL(Self)) (psXML(phoMessageXML(Self))) "utf-8" to vResponse

        If (IsNullComObject(vResponse)) Begin 
            Get ComLastErrorText of oHTTP to sLastErrorText
        End
        Else Begin 
            Set pvComObject of oHTTPResponse to vResponse
            Get ComStatusCode of oHTTPResponse to iStatusCode
            If (iStatusCode=HTTP_OK) Begin 
                Get ComBodyStr of oHTTPResponse to sLastErrorText        
            End
            Else Begin 
                Get ComLastErrorText of oHTTP to sLastErrorText
            End
        End
    End
    Function_Return iStatusCode
End_Function
link

answered Mar 13 '13 at 05:29

CDS's gravatar image

CDS
169912

Check to see if this new build has the same issue: http://www.chilkatsoft.com/preRelease/ChilkatHttp.zip

link

answered Mar 13 '13 at 10:38

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

If you believe the problem still exists, examine the contents of the LastErrorTest property after calling PostXml to ensure you're actually using this new build.

(Mar 13 '13 at 10:39) chilkat ♦♦

Hi Matt I'm not seeing any difference

The AbortCheck is still called many times even if HeatBeat is set to 0 and the heart beat value seems to be ignored

The DllDate in LastError is March 11

If I set it to 0 the Last error text contains IPV6 enabled connect with NO heartbeat.

If I set it to 5000 That line does not appear but no line contains 5000 or the word heartbeat

Thanks in advance

link

answered Mar 13 '13 at 13:13

CDS's gravatar image

CDS
169912

I understand the problem now. In other Chilkat ActiveX's the PercentDone event includes an argument for setting an abort flag. This is the case for the HTTP API in other programming languages. However, w/ the ActiveX the PercentDone event did not include the abort argument, and therefore to make it compatible, each PercentDone event is followed with an AbortCheck event. Therefore, in this particular case, the HeartbeatMs property controls AbortCheck events in general, except for those triggered by PercentDone. This is not something that can change, at least for now. The reason is that the ActiveX API cannot change because it would affect other programs that might be depending on it (known as DLL Hell where a DLL is updated and adversely affects existing programs).

The solution is for your application to simply ignore those AbortCheck callbacks. There shouldn't be more than 100 of them for any given HTTP request/response.

link

answered Mar 13 '13 at 15:57

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for the explanation Matt. Thats fine. Knowing that gives me the option to ignore it completly or simply increment a couter to know we are still moving etc

link

answered Mar 14 '13 at 05:35

CDS's gravatar image

CDS
169912

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3
×1

Asked: Feb 27 '13 at 05:42

Seen: 1,369 times

Last updated: Mar 14 '13 at 05:35

powered by OSQA