Esempio n. 1
0
        public async Task SendAsync(NetwrkWebMessage message)
        {
            await writer.WriteLineAsync(message.ToString());

            if (message.Data != null && message.Data.Length > 0)
            {
                Stream.Write(message.Data, 0, message.Data.Length);
                Stream.Flush();
            }
        }
Esempio n. 2
0
        public async Task SendAsync(NetwrkWebMessage message)
        {
            var mess = message.ToString();

            mess = mess.Replace("\n", "\r\n");
            mess = string.Concat(mess, "\r\n");

            await writer.WriteLineAsync(mess);

            if (message.Data != null && message.Data.Length > 0)
            {
                Stream.Write(message.Data, 0, message.Data.Length);
                Stream.Flush();
            }
        }