Closed localcc closed 3 years ago
Hello,
Please try not to destroy the packet after you enqueued it for sending. If I remember correctly unless you define a flag for manual memory management for the packet, the destruction should happen automatically after the packet was successfully sent (please keep in mind there might be some re-sends happening). You can check the source code for more details.
Cheers!
Thanks, that worked. By the way, there is another issue when server gets flooded with packets enet_host_service returns -1 and errno is set to EAGAIN, shouldn't the library handle that case and continue working?
Not exactly sure about your use case. Have you tried researching this issue within the original fork? It has a much bigger knowledgebase stored within the issue section.
Haven't found any issues in original fork. But based on original fork's code this should occur there too, it will happen on my previous sample code if removing std::this_thread::sleep_for. The library will print Error receiving incoming packets: Resource temporarily unavailable
Linux socket wiki says that means packets should be queried again, and that is being confirmed by errno flag being set to EAGAIN
After some information scattering found that this actually should happen because that is how nonblocking sockets work in linux network stack. Anyways as the issue was solved, closing it. Thanks!
What should happen: library should continue working and sending packets back and forth What happens: library crashes application with malloc(): unaligned tcache chunk detected
Code to reproduce: Server
Client