3 ms·
Very nice. I had looked into using tasks for TCP servers written in dotnet core C# recently. I find it mildly annoying that some of the async socket IO in C# is
by jchw 8y ago
Very nice. I had looked into using tasks for TCP servers written in dotnet core C# recently. I find it mildly annoying that some of the async socket IO in C# is not easily awaitable, but after working around that I found it fairly easy. All in all, I see a good future for dotnet core. I can recommend the Jetbrains Rider IDE to go with it.
- taspeotis 8y ago> some of the async socket IO in C# is not easily awaitable Do any examples come to mind? I thought Microsoft did a pretty thorough job of adding async support to nearly all of the BCL in .NET 4.5. Not saying there aren't gaps, I'm just curious. Sockets' non-blocking model is an excellent candidate for async/await-ifying.
- jchw 8y agoThe methods on Socket don't have async methods. As others have pointed out, you can use NetworkStream. I have missed the memo on that :)
- int_19h 8y agoThere were plenty of gaps really. Async'ification is still ongoing, but I don't think we'll ever see it in classic .NET - Core is where it's at these days.
- benaadams 8y agoI think the pattern is to give the socket to a `NetworkStream` constructor, then it has all the regular async methods on it.
- oaiey 8y agoSearch for system.io.pipeline. big stuff is coming there.