Hey all,
Hypothetical here...
Let's say that I have a TCP Client component that has events for the usual: OnConnect, OnReceive, etc...
Since I don't want that component to run on the Main thread, I want to nest it, cosily, in a thread.
But this now leaves me with a nagging question: What should the thread's Execute be doing?
I'm guessing that it should see if there is anything in the incoming buffer and read it, otherwise it should sleep for predefined amount of time, right?
And to display this incoming data, use the well know Synchronize.
But what about that event OnReceive, where should I connect that? Or should I not connect it?
I'm also guessing that if I want the GUI to send data through the TCP Client I need to have the access to the TCP Client inside a thread safe manner, with a Critical Section.
Is this the proper way to do it?
And is there a simple example I can look at to learn the details that I've glossed over here?
Cheers,
Gus