Skip to content

Example server does not run. Handshake packet recycle exception #4

Description

@BrixsterPlanet

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions