-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I believe that the example server is incorrect in its handling of the connection handshake: https://github.com/willardf/Hazel-Examples/blob/2bf9821cb57d56802e572a4c1bb74f39d391cfed/1 - SimpleServer/Program.cs#L116
Was scratching my head for a few hours why the example code kept throwing a Duplicate add MessageReader exception, and I started digging through the code to see if I misunderstood it. Then I got to the documentation for NewConnectionEventArgs.Handshake:
The data received from the client in the handshake. You must not recycle this. If you need the message outside of a callback, you should copy it.
Without the recycle call, the example runs fine for me.
@willardf Does the Among Us server recycle handshake messages? I'm conflicted on if this is intended behavior, because everything is pointing towards not recycling them. I'm looking into using the Hazel fork for my own projects, and I'm pretty stoked so far with reliability in the tests I've run.