Closed AriFordsham closed 1 year ago
The main reason is the performance hit when you allocate on each recv(_ex).
Common uses for windivert usually don't need the data to live long and it's usually injected (send) or discarded before calling recv(_ex) again to get the next packet(s)
Even in cases where you might conditionally copy the data to another place, reusing the same buffer offers a better performance
Using a buffer as parameter allows the crate user to decide how and when to allocate
I'm closing this for now
Feel free to continue in discussions if you have any other question. I didn't know I had them disabled 😅
Thank you for this package!
Why is it neccessary for the
recv(_ex)
functions to be supplied with a buffer? Why can't the library allocate this?