Jump to content

APAPE

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. APAPE

    IdThread and THttpCli

    I have debugged a little bit. In the unit "OverbyteIcsHttpProt" in class "THttpCli" in method "DoRequestSync", and in the while FState <> httpReady do loop the state (FState) is always "httpDnsLookupDone", but does not change any more. I looked a little bit deeper into unit "OverbyteIcsWSocket" into procedure TCustomWSocket.Connect where the method "WSocket_Synchronized_Connect" is being called, and this method returns 10035. I searched again in the internet and found the following site: https://stackoverflow.com/questions/16488603/overbyteics-http-timeout-when-used-in-different-threads And the S O L U T I O N is very simple: DO NOT CREATE THE ICS OBJECTS AT THREAD CREATION TIME, create and destroy them every time you need them in the thread! Hope, this helps to save others time in future
  2. APAPE

    IdThread and THttpCli

    I'm using the TIdThread object for many years, because it can be started and stopped without needing to destroy and recreate it. It is very handy. It does not make any difference, if I use a normal "TThread" or "TIdThread" for execution. The THttpCli object always throws an timeout exception and the requested URL is never been called. I do not use Indy for other things. I just use the TIdThread object.
  3. I have build a thread (using TIdThread), which can be startet multiple times to get data from different places. Each thread processes accesses one place / Url. I'm using a thread for each place to get the data of each of them totally as quick as possible. So the longest time is just the one which needs the longest time to retrieve the data. I set the property "MultiThreaded" to true in the component. Calling the .Post method does not work. I always get a timeout. If the same code is executed not as a self running thread, it works fine. I did not find any help on the internet. Does anybody knows why this timeout appears and how it can be moved away (so the thread does it's job)? I'm using Delphi 2007 and the main application also uses THttpCli components. Please help. Thx.
×