1234567891011121314151617181920 |
- using System;
- using System.Net.WebSockets;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- namespace gameapi.Commands
- {
- public class PongWebsocketCommand : IWebsocketCommand
- {
- public PongWebsocketCommand()
- {
- }
- public async Task Run(WebSocket webSocket)
- {
- await webSocket.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes("pong"), 0, 4), WebSocketMessageType.Text, true, CancellationToken.None);
- }
- }
- }
|