Exemplo n.º 1
0
        public override async Task ReceiveAsync(WebSocket socket, WebSocketReceiveResult result, byte[] buffer)
        {
            var socketId = WSConnectionManager.GetId(socket);
            var message  = $"{socketId} said: {Encoding.UTF8.GetString(buffer, 0, result.Count)}";

            await SendMessageToAllAsync(message);
        }
Exemplo n.º 2
0
        public override async Task OnConnected(WebSocket socket)
        {
            await base.OnConnected(socket);

            var socketId = WSConnectionManager.GetId(socket);
            //  await SendMessageToAllAsync($"{socketId} is now connected");
        }
Exemplo n.º 3
0
 public WSHandler(WSConnectionManager webSocketConnectionManager)
 {
     WSConnectionManager = webSocketConnectionManager;
 }
Exemplo n.º 4
0
 public ChatRoomHandler(WSConnectionManager webSocketConnectionManager) : base(webSocketConnectionManager)
 {
 }