Exemple #1
0
 internal async void SendMessageToId(string socketId, object message, messageType type)
 {
     if (webSocketsCollection.ContainsKey(socketId))
     {
         var          socket = webSocketsCollection[socketId];
         ReturnStream rs     = new ReturnStream()
         {
             messageStatus = resultStatus.success,
             messageType   = type,
             data          = message
         };
         var bytes        = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(rs));
         var arraySegment = new ArraySegment <byte>(bytes);
         await socket.SendAsync(arraySegment, WebSocketMessageType.Text, true, CancellationToken.None);
     }
     else // todo it not found ??
     {
     }
 }
Exemple #2
0
 public object Any(ReturnStream request) => request.Data;
 public object Any(ReturnStream request) => request.Data;