willardf / Hazel-Networking

Hazel Networking is a low level networking library for C# providing connection-oriented, message-based communication via RUDP.
MIT License
391 stars 60 forks source link

Make reader size configurable and reduce the default #56

Closed willardf closed 1 year ago

willardf commented 1 year ago

I didn't put the variable in Connection or UdpConnection because it would affect the *ServerConnection classes, but never be used.

Also I happened to see an unused const. I liked the locally-scoped version better currently in use.

Also fixed a flaky test:

  1. We enqueue packets 1, 2, 3 for remote.
  2. Release semaphore once, drop 2, release semaphore once.
  3. In debug or if you run just the one test in release, this works and the remoteresponds ack 1, 3.
  4. If you run the tests in sequence in release, then releasing the semaphore doesn't pull packet 1 off the queue, fast enough so drop 2 becomes drop 1 and the remote responds ack 2, 3.