iamkinetic / NEventSocket

A reactive FreeSwitch eventsocket library for .Net/.Net Framework (.net standard 2)
Mozilla Public License 2.0
26 stars 11 forks source link

Parse messages and events based on byte arrays instead of strings #10

Open ajgolledge opened 3 years ago

ajgolledge commented 3 years ago

Parse responses encoded in multibyte character sets (e.g. UTF-8) correctly by applying the content length given in the response to the length of the raw byte array and not the encoded string. The length of the string and the length of the byte array are not necessarily equivalent.

danbarua commented 1 year ago

This is a valid request, and the implementation needs to be looked at carefully to avoid thrashing the Garbage Collector in high-traffic applications.

If my memory serves me correctly I have looked into it in the past and hit an obstacle with cleanup.

danbarua commented 1 year ago

And we are in Modern DotNet where we now have Span<T> and other useful things in the base class libraries.

The original NEventSocket was intended to run on Mono as well as DotNet, we can make some big improvements now that dotnet is properly cross-platform.