Skip to content

Commit

Permalink
Check IsDisposed in IO loop
Browse files Browse the repository at this point in the history
  • Loading branch information
KodamaSakuno committed Aug 8, 2019
1 parent 7370ab9 commit 1fa8446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Andoromeda.Socket.IO.Client/SocketIOClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ async ValueTask Start()

async Task SendLoop()
{
while (true)
while (!IsDisposed)
{
var packet = await _sendChannel.Reader.ReadAsync().ConfigureAwait(false);

Expand Down Expand Up @@ -340,7 +340,7 @@ async Task SendLoop()

async Task ReceiveLoop()
{
while (true)
while (!IsDisposed)
{
var packet = await ReceiveEngineIOPacketAsync().ConfigureAwait(false);
if (packet is null)
Expand Down

0 comments on commit 1fa8446

Please sign in to comment.