How and Where to Learn Sockets in C#

Asked

Viewed 38 times

0

I am studying C# and decided to learn a little about Sockets and Connections, however, I’m still having doubts about how to study Sockets and where to find content about it, you have books or recommendations from somewhere that is good to study this content?

2 answers

0


Microsoft’s documentation has greatly improved compared to how it was before and features extensive and very detailed content on C#, F# etc. including Sockets. The documentation provides several articles, examples of use with a list of methods, classes, properties and namespaces of various Apis and different subjects. I say, from experience, that it is an excellent resource for studying C#.

Another site that also includes excellent documentation on everything involving the Web (and therefore connections also including the subject Sockets) is the Mozilla documentation, also with Sockets using C#.

From the "theoretical" and other related resources, I recommend that you do some project that involves what you learned by reading to fix knowledge and discover new things within the subject and use cases of each functionality that has been made available by a framework, technology and/or language you are learning. I also recommend that not just copy and paste the code, understand what is being done. Knowledge about a(s) tool(s) will come from consistent study and practice.

I hope I’ve helped in some way.

0

Look, I know you’re looking for C#, but if you want to try to dig deeper and go deeper into the business base one of the best materials on the subject and free - to get started - that if you have today is maybe this:

I would start with IPC (communication between processes) - If you have no notion yet http://www.beej.us/guide/bgipc/

Then I would go to Socket TCP, followed by UDP and finally leave other types. http://www.beej.us/guide/bgnet/

I also recommend reading Tanenbaum and Wetherall’s book on Computer Networks, but layers of transportation, which although not a simple read is the most refined in books on the subject of networks. Since book is not something auditable then people write a lot of disposable crap around and with quality label.

With a VM, a virtualized text-only debian you do a lot with it. Understanding the socket foundation, you easily apply in C#. If it is in windows, it is not so different since it is basically copy, but it has some directives that have to start before starting to operate the socket in Windows and these additional ones are dispensable in the socket understanding.

I also advise the use of tools like TCP dump and nmap - Wireshark and Zenmap and both doc are very good. They’re like your network bugger, and look, without them it’s very difficult to find an error, it’s no use to print the variable there that the business is sometimes not so banal.

Other very good materials to understand the concept of socket are:

Excellent manual by GNU: https://www.gnu.org/software/libc/manual/html_node/Sockets.html

The socket manual itself: https://www.man7.org/linux/man-pages/man2/socket.2.html

Funcao Socket: https://www.man7.org/linux/man-pages/man7/socket.7.html

With this it will give you a good basis of how it works, these manuals are not only explaining how to assemble the function, but a set of how it does to work.

There are other good materials. But these I gave you because they were the ones I used so much at the time that I did my tcc using making a game server, going through several, even when I wrote a guide on socket, if I could send along.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.