There is a task to write a simple HTTP server. All the examples that I met looked something like this:
while (true) { var context == listener.GetContext(); Task.run(() => HandleContext(context)); } Well, ok, but then why do you need HTTPListener.GetContextAsync () ;? Suppose if it were like this:
while (true) { var context = await listener.GetContextAsins(); Task.run(() => HandleContext(context)); } However, as far as I can tell, this is the same. I would be very grateful for an explanation of how to use this method to get some profit.
awaitfrom the inside of the task. - arrowd