Answer the question
In order to leave comments, you need to log in
How can I make the return type be Task?
Trying to apply the following solutions for websockets ( https://github.com/jjrdk/websocket-sharp/blob/mast... and immediately ran into a problem.
Code:
public class Echo : WebSocketBehavior
{
protected override void OnMessage(MessageEventArgs e)
{ Send(e.Data); }
}
в браузере сборок метод OnMessage выглядит так:
using System;
using System.Threading.Tasks;
protected virtual Task OnMessage (MessageEventArgs e);
Error CS0508: 'Echo.OnMessage(MessageEventArgs)': return type must be 'Task' to match member overridden 'WebSocketBehavior.OnMessage(MessageEventArgs)'.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question