Is it possible to repeat multiple times the ManualResetEvent?
Something like this:
receivedDone.WaitOne();
//something here
receivedDone.Set(); //this go back to receivedDone.WaitOne()
//when executing the second time will loop the receivedDone.Set() and not returning
//again to receivedDone.WaitOne(); like I wanted.
So my question is:
Is it possible to execute multiple times like a loop the same WaitOne(); and Set();?
EDIT:
I have a button, when I click it run a function to start my tcpclient.
After that I wait for some response from the server with the receivedDone.WaitOne();
when I receive the message on my buffer, it goes to receivedDone.Set();
. This works 1 time, but I want to make it multiple times with the same WaitOne(); and Set();
Is this possible?