public void Send(RealtimeTransportData data)
 {
     if (BinaryProtocol)
     {
         Task.Run(() => _socket.SendData(data.Data));
     }
     else
     {
         Task.Run(() => _socket.SendText(data.Text));
     }
 }
示例#2
0
        public void Send(RealtimeTransportData data)
        {
            if (BinaryProtocol)
            {
                _socket?.SendData(data.Data);
            }
            else
            {
                if (Logger.IsDebug)
                {
                    Logger.Debug("Sending Text: " + data.Text);
                }

                _socket?.SendText(data.Text);
            }
        }
示例#3
0
        /// <inheritdoc/>
        public Result Send(RealtimeTransportData data)
        {
            if (_socket is null)
            {
                return(Result.Fail($"Cannot send message. Socket instance is null. Transport state is: {State}"));
            }

            if (BinaryProtocol)
            {
                _socket?.SendData(data.Data);
            }
            else
            {
                if (Logger.IsDebug)
                {
                    Logger.Debug("Sending Text: " + data.Text);
                }

                _socket?.SendText(data.Text);
            }

            return(Result.Ok());
        }