C# Networking
Hi, switching to C# for an upcoming project. 13 year Java programmer. In Java I would write networking apps using the Netty framework.
What is the preferred way to do the same thing in C#? I’ve found DotNetty but that project looks dead.
Thanks guys!
8 Replies
what exactly do you mean by networking?
looking at the netty website it looks like most of that functionality is in the standard .NET libraries and the rest can be found on nuget
for standard HTTP work you will be using HttpClient or something built on top of it 99% of the time
I need TCP and UDP support. Netty for Java is an asynchronous solution vs plain Java sockets. Wondering what developers recommend for C#. I’m very green with C# and I’m trying to sort through the noise and get direct input from real people.
System.Net.Sockets Namespace
Provides a managed implementation of the Windows Sockets (Winsock) interface for developers who need to tightly control access to the network.
TCP Client, TCP Listener, UDP Client, and so on
yeah, there are specific classes but they're all just thin wrappers around a
Socket
which can already be used asynchronously in C#Seems that Netty handles a lot of the grunt work.
Netty does do a lot of the grunt work.
It's used by many big companies (google, facebook, etc) and has a lot of nice features.
Companies:
https://netty.io/wiki/adopters.html
Overview:
https://netty.io/index.html
I can write what I need from scratch, but their is no need to reinvent the wheel if a project like Netty already exists.
Thanks guys for your input!