예제 #1
0
        public override async Task OnBinaryAsync(WebSocketEventArgs e, byte[] buffer)
        {
            var content  = DeserializeFromBinary(buffer);
            var response = await MessageControllerFactory.ProcessAsync(content);

            if (response != null)
            {
                await SendTextAsync(e.SocketId, response);
            }
        }
예제 #2
0
        public override async Task OnTextAsync(WebSocketEventArgs e, string text)
        {
            var content  = DeserializeFromText(text);
            var response = await MessageControllerFactory.ProcessAsync(content);

            if (response != null)
            {
                await SendTextAsync(e.SocketId, response);
            }
        }
예제 #3
0
 public virtual async Task OnBinaryAsync(WebSocketEventArgs e, byte[] buffer) => await Task.CompletedTask;
예제 #4
0
 public virtual async Task OnCloseAsync(WebSocketEventArgs e) => await Task.CompletedTask;
예제 #5
0
 public virtual async Task OnTextAsync(WebSocketEventArgs e, string text) => await Task.CompletedTask;