When I want to use WSASend()
, I must provide a callback function (Completion Routine) that will be called by the system to inform me that the data has been sent.
But the problem is in order for the callback function to be called, the thread that calls WSASend()
must be in a wait state, and I want to call WSASend()
from the UI thread, so the UI would freeze in this case!
How can I fix this problem, should I create another thread that will call WSASend()
, and when I want to send data from the UI thread, I should "tell" the other thread that I want to send, and give it the buffer to send?
Aucun commentaire:
Enregistrer un commentaire