Beispiel #1
0
 private async Task SendObjectAsync(object payload, CancellationToken token)
 {
     await Task.Run(() =>
     {
         var json = JsonConvert.SerializeObject(payload, Formatting.Indented);
         _logger.LogDebug($"SEND: {json}");
         _socket.Send(json);
     }, token).ConfigureAwait(false);
 }