According to some samples in the internet and this guide I created a connection of webSocket .
public class sockets: IHttpHandler {
public bool IsReusable {
get {
throw new NotImplementedException();
}
}
public void ProcessRequest(HttpContext context) {
if (context.IsWebSocketRequest) {
context.AcceptWebSocketRequest(new socketHandler());
}
}
}
public class socketHandler: WebSocketHandler {
public socketHandler(): base(null) {}
}
There is an error in the line-
context.AcceptWebSocketRequest(new socketHandler());
the error:
Argument 1: cannot convert from 'socketHandler' to 'System.Func(System.Web.WebSockets.AspNetWebSocketContext,System.Threading.Tasks.Task)'
Can anyone help me?