Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Indy TCPClient or IOHandler
#1
Hi Guys

We are having some bugs in our application after migrating our source code from delphi 7 to XE2. Indy 9 and  was used in delphi 7 and XE2 respectively. 

The application is dll encapsulated windows COM Object and hosted with GUI.  

We use TCPClient that continuously send and receive data from a device (Server) every 2 seconds. Sending of data to the server is done in the Main Thread while reading the response in another Thread. FIdClient.IOHandler.Write(sData + FSendRcvTerminator, TEncoding.ANSI) for sending the data and reading with FClient.IOHandler.ReadBytes(LBuffer, -1, false). The application do work perfectly for days or weeks without any problem but after a while all the processes in the Main Thread hanged and stop responding meanwhile the processes in the other Thread continue working. It has been very difficult for us to locate the course of this problem.  Sending data with FIdClient.IOHandler.Write(sData + FSendRcvTerminator, TEncoding.ANSI)  to the Server from the other Thread gets the hanged processes in Main Thread working again. We are actually not satisfy with this workaround and want to know the course. The same code written in delphi 7 and Indy 9 is working without any problem.

The only difference in our code is that with indy 9 we did not use IOHandler to write or read from the socket.  What are we doing wrong here!       
       
Thanks
Reply


Messages In This Thread
Problem with Indy TCPClient or IOHandler - by Ayodeji - 06-28-2018, 08:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)