I am using a winsock and I am passing data back in forth from one app to another.

My problem is this: I have one app sending data to another app via winsock and I want the app sending data to wait until it gets back acknowledgement from the other app that it recieved the data and is ready for another record so basically what am trying to do is wait until the "DataArrival" event has been triggered then move on to the next record.