1

I'm new to Windows development, coming from macOS and iOS development.

I've to work with System.Net.WebSockets.ClientWebSocket to implement some sort of private push notification service.

I other languages I'm used to closure / blocks / functional programming to handle events like a WebSocket message.

Reading at System.Net.WebSockets.ClientWebSocket documentation, it seems really old school with read method that I have to call all the time.

Did I understood well?

How should I use System.Net.WebSockets.ClientWebSocket to handle messages in background as event and once they are here, call a specific block of code to handle them?

The goal is really to transform incoming message in events and then, handle those events in another part of the code.

1
  • Have a look at this answer. Do note that Sockets/WebSockets are low-level APIs. There are higher level APIs where you don't have to implement so many of the communication details yourself such as Web API 2 and WCF. Commented Jan 21, 2018 at 14:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.