public async Task SendMessageAsync([NotNull] JfpMessage message) { if (_streamReader == null) { throw new NotSupportedException("Underlying stream does not support writing."); } await _streamWriter.WriteLineAsync(JsonConvert.SerializeObject(message)); }
public void SendMessage([NotNull] JfpMessage message) { if (_streamWriter == null) { throw new NotSupportedException("Underlying stream does not support writing."); } _streamWriter.WriteLine(JsonConvert.SerializeObject(message)); }