A common approach is to use a worker thread to read the socket.
When the read call returns you can call a method of some class/interface that you design for your application. Keep in mind when the method executes it is running in the worker thread context.
or
When the read call returns you can signal a synchronization object that the data just read is available thereby passing control to another thread context.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.