Esempio n. 1
0
        private void SendMessage <T>(WebSocketDataModel <T> model, IWebSocketConnection socket)
        {
            model.CurrentDatetime = DateTime.UtcNow;
            var _modelSerialize = model.Serialize();

            socket.Send(_modelSerialize);
        }
Esempio n. 2
0
        private void SendMessageToAllClients <T>(WebSocketDataModel <T> model)
        {
            model.CurrentDatetime = DateTime.UtcNow;
            var _modelSerialize = model.Serialize();

            foreach (var item in SocketClients)
            {
                item.Send(_modelSerialize);
            }
        }