PDA

View Full Version : Comunication between threads



Bruschetta
5th December 2016, 08:53
I have a question and not an easy one for me, let me see if i can explain it well...

In my main page i create a thread and it's porpouse is to open a TCP connection with a server who's going to send to him (the client) some messages every few secs.
Meantime the main thread is going to make the application run.
So the user can open Dialog1, then Dialog2, then Dialog3 and finally Dialog4.

Dialog4 wants to know if the thread i started at the beginning (the TCP connection one) is receiving some particular messages.
The problem i'm facing is: How can i connect those events?
Thanks for your time and, i hope, answers and hints ;)

anda_skoa
5th December 2016, 10:34
Not sure why you need a separate thread for the TCP connection but if some messages are important elsewhere you need to store the fact that these have been received somewhere accessible from both locations.

Cheers,
_