This solution contains 4 projects to show network communication using Socket in different ways.
I've also written an article to in my LinkedIn called Network Programming in C# - Part 1 - Socket Programming in the following link:
https://www.linkedin.com/pulse/network-programming-c-part-1-amir-doosti-om8df
The solution contains 4 Console App projects which are written in C# in Visual Studio.
- OS: Windows 10 Enterprise - 64 bits
- IDE: Visual Studio Enterprise 2022 (64 bits) - version 17.2.5
- Framework: .Net 8
- Language: C#
Open the solution in Visual Studio and build all 4 projects then from the command line first run SocketServer and then SocketClient. You can terminate server program with Ctrl+C. Another pair is TcpServer/TcpClient. First run TcpServer and then TcpClient to see how they communicate. Again TcpServer can terminate with Ctrl+C.