How to pause execution of for loop until client responces?
I am writing a server program in which i want to pause my for loop execution when there is counter(int) is 25 at that time server asks a question to client "do you want to continue sending data?" if client response "yes" then my for loop should resume from counter 26. now my program when stopped in for loop in if using "thread.sleep()" , it is not get intocase when the client responce becaous control is in for loop so "sleep" method doesnt work for me here.Is there any possible way to achieve this in c#. (VS10)?