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 ?? { } }
public object Any(ReturnStream request) => request.Data;