public override async Task OnConnected(WebSocket socket)
        {
            await base.OnConnected(socket);

            var socketId = WebSocketConnectionManager.GetId(socket);

            await SendMessageToAllAsync($"{socketId} is now connected");
        }
示例#2
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="webSocketConnectionManager">コネクションマネージャ</param>
 /// <param name="logger">ロガー</param>
 public WebSocketHandler(WebSocketConnectionManager webSocketConnectionManager, ILogger <WebSocketHandler> logger)
 {
     WebSocketConnectionManager = webSocketConnectionManager;
     _logger = logger;
 }
示例#3
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="webSocketConnectionManager">コネクションマネージャ</param>
 public WebSocketHandler(WebSocketConnectionManager webSocketConnectionManager)
 {
     WebSocketConnectionManager = webSocketConnectionManager;
 }
 public TestMessageHandler(WebSocketConnectionManager webSocketConnectionManager) : base(webSocketConnectionManager)
 {
 }