On 10/21/2019 at 2:56 PM, Kylotan said:
At some level the 'thread-per-connection' argument becomes academic - your main logic is going to end up being handled in one thread anyway, so it's just a case of deciding where you cross that boundary. And if you have a language or library facility that lets you treat data from the network as events in your main thread, you've solved that problem, and only need to really worry about it if you have a performance issue - which, for 10 non-game connections, you almost certainly do not.
Indeed in my case it is really about "which is simpler to code" rather than "which is more performant". The modern .NET async classes seem (at first glance) to do a great job abstracting this to an asynchronous paradigm without making things much more complicated.
On 10/22/2019 at 1:39 AM, hplus0603 said:
The asynchronous threading in Windows .NET is generally done by a thread pool, which uses an automatically managed number of threads.
The .NET primitives are built on top of the Win32 primitives: OVERLAPPED I/O, GetQueuedIOCompletionStatus(), and CreateThreadpool(). Reading the documentation for how those work, may lead to some more insights about how the .NET implementation presumably works. Reading the open source implementation of .NET Core might also help.
If you're using Mono, then all bets are off, because they appear to use more regular threads, rather than Windows-specific primitives, in their implementation.
Interesting point on mono
I assume this is THE book to which @hplus0603 referred originally; I have seen it recommended elsewhere when googling "best TCPIP book" etc: https://www.amazon.co.uk/TCP-IP-Illustrated-Protocols-APC/dp/0201633469
It looks like I will have to buy a used hardback copy which suggests it's not widely used, but might be one of those books I should own in my library almost regardless how much network coding I might do?
I would still love a C#-focused version. I can't find much though I was wondering about something like this: https://www.amazon.co.uk/dp/1789340764 anyone here read it? I Find books still preferable to online documentation for in-depth learning and reading, personally.