✅ Stack overflow.
Im doing a server in c#
here is the main
Ok so the problem is
Console.WriteLine("{DATA IN}: " + message);
in HandleMessage function is getting spammed and server crashes
3 Replies
Also tried to use async in this way
I tried to but still crash
still crashed when mv gets called
i would just use async everywhere and avoid threads if there's no need for it
so, what is the error
The error is That the client is going to send a json which contain ready msg. What i want to do is that server should do some logic, wait for 7 seconds and then send result packet to clients. so when adding Thread.Sleep(7000); after the 7 seconds pass it start spamming as shown in picture
i tried to make HandleJson function async and i did await Task.Delay(7000);
It stopped spam after sending the result packet. But the problem is after the result packet client will send mv to the server, if i write any code inside mv it will start spamming same thing
i did everything async
still same thing
removing await wont crash the server
Nvm i figured it out thx