public void AcceptWebSocketRequest(Func <IWebSocket, Task> callback) { #if NET45 _context.AcceptWebSocketRequest(ws => { var handler = new AspNetWebSocketHandler(); var task = handler.ProcessWebSocketRequestAsync(ws); callback(handler).Then(h => h.CleanClose(), handler); return(task); }); #else throw new NotSupportedException(); #endif }
public void AcceptWebSocketRequest(Func<IWebSocket, Task> callback) { #if NET45 _context.AcceptWebSocketRequest(ws => { var handler = new AspNetWebSocketHandler(); var task = handler.ProcessWebSocketRequestAsync(ws); callback(handler).Then(h => h.CleanClose(), handler); return task; }); #else throw new NotSupportedException(); #endif }
public void AcceptWebSocketRequest(Func<IWebSocket, Task> callback) { #if NET45 _context.AcceptWebSocketRequest(ws => { var handler = new AspNetWebSocketHandler(); handler.ProcessWebSocketRequestAsync(ws); return callback(handler); }); #endif }