Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Indy TCPClient or IOHandler
(06-29-2018, 02:41 PM)Ayodeji Wrote: The Indy TCPClient component is not directly use in UI and doesn't have direct interaction with UI, The Main Thread that I am referring to is implemented in dll. Then we have a standalone UI application that loads the dll.    

Just because it is implemented in a DLL does not change how threading works. As you said earlier: "Sending of data to the server is done in the Main Thread". Whether the code is implemented inside a DLL or inside the app itself, it should not be executed in the main UI thread, but rather in a worker thread. The UI thread should ONLY service the UI and NOTHING ELSE.

(06-29-2018, 02:41 PM)Ayodeji Wrote: The code can handle partial data. Yes it has a communication structure with terminator for outbound and inbound data. We didn't have any problem reading the data.

Well, clearly you do have issues with how you are managing the communications, or you would not be asking for help here.

If the communication has structure to it, then why aren't you waiting for a complete message to arrive before you process it? Why are you reading it in arbitrary blocks of partial data? You shouldn't be doing it that way. One of Indy's strengths is being able to handle structured data.

(06-29-2018, 02:41 PM)Ayodeji Wrote: The implementation of TCPClient that send to server is not in UI Main Thread.

That is not what you said earlier (see above).

(06-29-2018, 02:41 PM)Ayodeji Wrote: My Boss wouldn't allow me to post the code here.

Then I can't help you further with your UI blocking issue. Based on everything you have described so far, it is clear that you are not using Indy correctly/effectively, but without seeing CODE, I can't tell you what is wrong with it, or how to make it work correctly/better.


Messages In This Thread
RE: Problem with Indy TCPClient or IOHandler - by rlebeau - 07-01-2018, 03:02 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)