Linux is the best platform anyways to run your .net core application. With Avalonia you have a good cross-platform solution, albeit that they still depend on X11/Xwayland for Linux.
A shame .net isn't more popular. The MS branding is a problem though. Although .net core is MIT-licensed, most contributions are from MS¹. Still, if MS would ever ditch it (quite unlikely for the foreseeable future), I think the ecosystem will step up.
__
1. F# is an outlier, that is a real community project with lots of contributions from companies and enthusiasts
Instead, the TCP socket must be treated as a stream of bytes, and use either some delimiter as message boundary (like \n, while escaping any newlines inside JSON), or write message size before the message bytes itself, so that the code knows how many bytes to read until full message is read.
Edit: to clarify, TCP protocol does not guarantee that if you write some bytes in one go, they will be read in one go as well. Instead, they may be split into multiple “reads”, or glued together with the preceding chunk, or both. It’s a “stream of bytes” protocol, it only guarantees that written bytes come one after another in the same order.
So the “naive” message separation used in code above (read a chunk and assume it’s the entire message that was written) will work in manual tests, and likely even in local automated tests, but will randomly break when exposed to real network conditions.
https://github.com/Sieep-Coding?tab=repositories&q=&type=&la...
DoctorOW•1d ago
ETA: Not being dismissive! Cool project!
sieep•23h ago