public void Send(RealtimeTransportData data) { if (BinaryProtocol) { Task.Run(() => _socket.SendData(data.Data)); } else { Task.Run(() => _socket.SendText(data.Text)); } }
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); } }
/// <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()); }