Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Ack Infinite loop #12

Closed
nickolanack opened this issue Jul 20, 2021 · 0 comments · Fixed by #13
Closed

Ack Infinite loop #12

nickolanack opened this issue Jul 20, 2021 · 0 comments · Fixed by #13

Comments

@nickolanack
Copy link
Contributor

When emitting some event/data and providing a delegate for ack, I run into an infinite loop in SocketIOAckManager.cs

client.Emit("someEvent", someJObject, delegate(JToken[] ack){
    //...
});

for (int i = 0; true; i++)
{
if (i < AckList.Count)
{
if (AckList[i] == null)
{
Result = AckList[i] = new SocketIOAck(i, Callback);
}
}
else
{
SocketIOAck Ack = new SocketIOAck(AckList.Count, Callback);
AckList.Add(Ack);
Result = Ack;
}
}

I think for loop should break after inserting SocketIOAck object.
Adding break; after line 89, and line 97 solved the issue for me (and greatly reduced my cpu load 😉 )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant