Goobwabber / BeatTogether.LiteNetLib

An Asp.Net LiteNetLib server implementation, designed with BeatTogether's use-case in mind.
1 stars 3 forks source link

Edge-case StackOverflowException #2

Closed Goobwabber closed 2 years ago

Goobwabber commented 2 years ago

A StackOverflowException can occur if too many packets (a few thousand) are received in a short period of time

This is caused by UdpServer.ReceiveAsync() continuing on the same stack if the server has already received another message, causing recursion that can continue infinitely if enough packets have been received. This issue can't really be fixed without replacing the NetCoreServer requirement but could be mitigated by reducing packet processing times. Either way, this is an edge-case scenario and unlikely to occur - but note should be taken that this is possible.