Jump to content

Angus Robertson

Members
  • Content Count

    1731
  • Joined

  • Last visited

  • Days Won

    33

Posts posted by Angus Robertson


  1. Power broadcasts give warnings when the system is about to close down, while designed for battery powered kit, they do work on desktops, my PCs have USB connection to the APC UPS so can close down early.  Can not say specifically under what circumstances these messages appear, but belt and braces when saving data...

     

            PBT_APMBATTERYLOW: mess := 'Battery power is low' ;
            PBT_APMQUERYSUSPEND: mess := 'Request for permission to suspend' ;
            PBT_APMSUSPEND: mess := 'System is suspending operation' ;
     

    Angus


  2. As I said, you are recursively starting a new HTTP request from the within an event called by that request, you need to start the next request outside the event, either from a timer as I suggested, or by sending a message to a function that starts the next request.  Sleep stops messages being processed so defeats the concept of event driven programming, it should only generally only be used in threads that don't do anything else.

     

    Angus

     

     

     

    • Thanks 1

  3. Not looked closely at your code, only got as far as sleep in an event handler which is very bad design. You are also recursively starting a new request from the event, which calls the event again...

     

    To use async functionality properly, you should use a timer and triggers.  ICS provides such functions in  OverbyteIcsUtils, ie IcsGetTrgSecs, IcsGetTrgMins, IcsTestTrgTick which are used in OverbyteIcsSslMultiWebServ1.pas as an example.  You set a trigger in the event to how every many seconds you want to wait, then test it in a timer triggering once a second or slower, then start the next request. 

     

    Angus

     

    • Thanks 1

  4. From that extra information, I assume the first POST attempt succeeded, you then had a time out due to a bad connection and it died.,  This goes back to what I said yesterday, Windows keeps trying to open a TCP connection and you can not stop it early with a timeout, only by freeing the socket and starting again with a new socket.  

     

    This is nothing to do with threads, just standard TCP connections.  And why we recommend using a array of several hundred dynamically created THttpCli components all using async methods running in parallel sharing the same events for testing lots of remote sites.  No threads necessary. 

     

    Angus

     


  5. TIdThread is not an ICS component, probably Indy, which may mean  you have mixed two libraries.  May or may not be relevant to your problem. 

     

    The only benefit of using threads with ICS to download multiple URLs is where the host is unavailable and Windows waits up to 30 seconds attempting to connect, blocking other actions. Apart from that, ICS will do several hundreds downloads in parallel. 

     

    The most important issue if you really need to use threads is to make sure the ICS message pump is called in a solid loop if using async methods. 

     

    Angus

     


  6. Clouldfare supports QUIC/HTTP/3 now, so it's not just Google and has published speed comparisons. https://blog.cloudflare.com/http-3-vs-http-2/

     

    We don;t expect any problem updating ICS to support OpenSSL 3.0, but won't do it until the API is stable with the first beta release in a month or two.  OpenSSL plans QUIC/HTTP/3 for the release after 3.0, six to 12 months away.   Hard to know how hard it will be to implement in ICS, but we'll certainly have a go. 

     

    Supporting LibreSSL in ICS is possible, the API interface library is designed to support different OpenSSL versions dynamically, the main issue is LibreSSL has 'improved' some of the OpenSSL APIs, many macros are now function calls instead (good thing),  So quite a lot of effort required to support LibreSSL with no obvious improvements to end user applications, 

×