jchristn / SuperSimpleTcp

Simple wrapper for TCP client and server in C# with SSL support
MIT License
459 stars 95 forks source link

Reducing memory allocations for receiving data #148

Closed joreg closed 2 years ago

joreg commented 2 years ago

For both Client and Server:

Breaking Change:

DataReceivedEventArgs now return an ArraySegment that directly refers to the internal MemoryStream removing one unnecessary allocation per receive.

this is in line with https://github.com/jchristn/WatsonWebsocket/pull/95

jchristn commented 2 years ago

Thank you @joreg - integrating now!

jchristn commented 2 years ago

Commit: https://github.com/jchristn/SuperSimpleTcp/commit/5c4bfbef56dd7a5a2e437f17ac62450f26feb3bf NuGet: https://www.nuget.org/packages/SuperSimpleTcp/3.0.0

Thanks for making the library better!