We are implementing Client WebSocket for our .Net Application using the ClientWebSocket class in System.Net.WebSockets namespace. We are calling ClientWebSocket.ConnectAsync Method (Uri, CancellationToken) for Asynchronous socket connection. And after the successful asynchronous connection is done, we need to call a callback function. But we are not sure how to call the callback function. Please help us to do the same.
What I have tried:
We tried the System.Threading.Tasks.Task class's ContinueWith(Action<Task, Object>, Object, CancellationToken) method to call the callback function but we could not succeed. Please let us know the best solution to our problem.