Skip to content

Commit

Permalink
forgot an important "if" on the Message handler of Connection channel…
Browse files Browse the repository at this point in the history
… !!!

(did not break any Unittests!? Why?)
  • Loading branch information
RobertK66 committed Jul 2, 2024
1 parent a74dd4d commit 5d8605e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Sharpcaster/Channels/ConnectionChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ public async Task ConnectAsync(string transportId)
/// <param name="message">message to process</param>
public async override Task OnMessageReceivedAsync(IMessage message)
{
// In order to avoid usage deadlocks we need to spawn a new Task here!?
_ = Task.Run(async () => {
await Client.DisconnectAsync();
//await Task.Delay(2000);
});
if (message is CloseMessage) {
// In order to avoid usage deadlocks we need to spawn a new Task here!?
_ = Task.Run(async () => {
await Client.DisconnectAsync();
//await Task.Delay(2000);
});
}
await base.OnMessageReceivedAsync(message);
}
}
Expand Down

0 comments on commit 5d8605e

Please sign in to comment.