Using Asynchronous Callbacks

Most of you who have done any kind of socket programming will understand the problems associated with blocking sockets, and in our previous examples we face this exact problem, where a remote method might take quite a while to return, and then our program will simply freeze until the remote call returns. This is not at all a favorable kind of scenario and one to be totally avoided. An idea that might strike you instantly is to start a worker thread to make remote calls, but as the number of remote calls increases, this soon becomes a major headache as far as maintenance and data synchronization goes. Luckily, remoting provides us with the ability to use asynchronous callbacks. Basically what this means is that you ...

Get Extending MFC Applications with the .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.