1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-07 16:06:15 +00:00
This commit is contained in:
Jan Korf 2022-04-30 18:31:14 +02:00
parent 94b8184f7b
commit cb9a766c3b
2 changed files with 5 additions and 3 deletions

View File

@ -242,11 +242,13 @@ namespace CryptoExchange.Net.Sockets
/// <inheritdoc />
public virtual async Task ProcessAsync()
{
log.Write(LogLevel.Trace, $"Socket {Id} ProcessAsync started");
var sendTask = SendLoopAsync();
var receiveTask = ReceiveLoopAsync();
var timeoutTask = Timeout != default ? CheckTimeoutAsync() : Task.CompletedTask;
log.Write(LogLevel.Debug, $"Socket {Id} processing started");
log.Write(LogLevel.Trace, $"Socket {Id} processing startup completed");
await Task.WhenAll(sendTask, receiveTask, timeoutTask).ConfigureAwait(false);
log.Write(LogLevel.Trace, $"Socket {Id} ProcessAsync finished");
}
/// <inheritdoc />

View File

@ -254,12 +254,12 @@ namespace CryptoExchange.Net.Sockets
private void StartProcessingTask()
{
log.Write(LogLevel.Trace, $"Starting {SocketId} processing task");
log.Write(LogLevel.Trace, $"Starting {SocketId} process/reconnect task");
_socketProcessReconnectTask = Task.Run(async () =>
{
await _socket.ProcessAsync().ConfigureAwait(false);
await ReconnectAsync().ConfigureAwait(false);
log.Write(LogLevel.Trace, $"Processing {SocketId} task finished");
log.Write(LogLevel.Trace, $"Process/reconnect {SocketId} task finished");
});
}