Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
TCP/IP Socket Programming in C# .Net For Coders & Students
Highest Rated
Rating: 4.5 out of 5(1,347 ratings)
11,973 students

TCP/IP Socket Programming in C# .Net For Coders & Students

C# Networking in TCP/IP Socket Programming, WinForms & async/await examples - Sockets Code .Net 10 Verified in 2026
Created byNaeem Akram
Last updated 8/2026
English
GermanEnglish

What you'll learn

  • TCP/IP Socket programming basics and advanced level with async/await in C# .Net
  • Develop a sound understanding of how networking applications communicate in C# .Net
  • Network Programming using .Net Framework networking Namespaces in C#
  • C# Networking

Course content

6 sections54 lectures3h 28m total length
  • Introduction to TCP/IP socket programming in C# .Net using Visual Studio4:20

    This course is for programming professionals who have some programming experience but never tried network programming

    Many courses and books about network & socket programming pile up tonnes of theory before the real code. That's not the way programmers do it. I have tried to take a different approach and we will get started with only the essential theory and jump into code ASAP.

    I am a rookie coder, I've been out there for so many years and written a lot of code (C++, C# .Net, Java) until so far. Because of my approach, will be in a sound position to write software capable of sending and receiving data over the network before the end of this course.

  • Downloading Source Code3:09

    Download source code from each lecture via the video download icon, the course content tab, or GitHub repositories. Access up-to-date, section-specific client and server source code and slides.

  • 2026 Update: Modernizing the Server to .NET 10 with Claude5:07

    I recorded this course back in 2014, and I still can't quite believe I'm adding a lecture to it in 2026 — but here we are. In this update, I open the original server project in Visual Studio 2026 to confirm it still builds, then use Claude to migrate the solution from .NET Framework 4.5.2 to .NET 10 live, with no code changes required. As I mention in the video, the core System.Net.Sockets API you're learning in this course hasn't meaningfully changed since .NET 4.5 — the concepts you're building here are still exactly what you'll use today.

    Once the migration is verified, I open the same project in VS Code, run it with dotnet run, and confirm the server still accepts connections and echoes data back, just like earlier in the course.

    The updated, .NET 10-targeted source code is available here: https://github.com/naeemakram/ClaudeDotNet10UpdateTcpSockets

  • The Host In Computer Network - Networking Essentials1:25

    The Host

    A computer network is made up of hosts, which are also called nodes. A host can be a laptop, a smart phone, a router, or anything and everything that is capable of connecting to the TCP/IP network.

  • IP Address In Computer Network - Networking Essentials1:04

    An Internet Protocol Address is also called IP Address for short. Every host(computer/phone/router etc.) in a computer can be reached by a unique IP Address.

    We will use IP addresses conforming to Internet Protocol Specifications version 4 AKA IPv4, a newer version of IP specifications called IPv6 is also available but it is catching up with the widely used IPv4.

    An IPv4 address is basicallly a group of four 8 bit numbers. Each number in the group can have a value between 0 to 255.

    When printing an IP address the 4 numbers mentioned above are seperated dot character . to make an IP address easily readable.

  • Port Numbers In Computer Network Socket Programming- Networking Essentials1:26

    Note: You may watch the video first and take a look at the description later on if you forget something.

    In order to understand port numbers we consider that our PC is an apartment building. This apartment building can be reached using a specific street address. In our case it will be an IP address.

    The apartment building is further divided into apartment numbers. Every apartment is identified by a unique apartment number.

    Just like apartments a computer contains a large but finite number of ports, each identified by a numeric value.

    A single port can be used to read/write or send/receive data by only one process at any time.

    When we need to send data to a software process running on another computer or even on the same computere we need to know the IP address of the remote peer and the port number being used by the peer software process.

    A combination of IP and port is called an EndPoint.

    There are total 65536 ports on a computer. Port numbers from 0 to 1023 are reserved for operating system usage. These are also called well-known ports or system ports.

  • Client/Server Model as used in TCP/IP Stream Sockets - Networking Essentials3:39

    Note: You may watch the video first and take a look at the description later on if you forget something.

    This lecture explains how a server process and a client process work together using TCP/IP stream sockets.

    The client and server are two separate processes which might be running on two different computers, or on the same computer.

    The server proess must start first and perform an accept connections operation. It will use a specific IP Address & port number AKA EndPoint for this purpose.

    The client process will be started afterwards. In order t connect with a server the client process will need to know the IP address and the port number on which the server is listening for incoming connections.

    If an attempt to connect fails, an exception will occur in client process.

    Connection attempts can fail for various reasons, common reasons of client/server connectivity failure include

    1. Windows Firewall blocked either the client process or the server process
    2. The IP address supplied a server IP address to the client is incorrect.
    3. The port number supplied to the client process as server port number is wrong
    4. The server process was not started
    5. The server process was started but it crashed

    Once a connection is established, both client and server can perform read and write or send and receive operations in order to send and receive data. Remember, a peer(server or client) can perform a write data or send operation only when the other end has already performed a read data or receive operation.

    The client and server can receive and send data to each other as long as both are running and a network connection is available.

    The client or server might close the connection whenever they want. A client or server may exit for any reason.

    If one end goes offline, the other end will receive an exception.

  • Enable the Telnet client utility - Networking Essentials1:18

    This video shows you how to enable Telnet Client Windows utility, telnet will play an instrumental role in section 2 of this lecture.

    Telnet is a feature of Windows OS, its disabled on most machines but users might enable it whenever they want.

  • Test your Networking Essentials knowledge

Requirements

  • C# .Net programming language, basic skills
  • Microsoft Visual Studio 2015, 2017 or above will be needed to write C# .Net async code shown in this course
  • A PC which is connected to a network using Ethernet or WiFi capable of running .Net

Description

Get proficient in computer network socket programming using TCP/IP streaming sockets and become a better professional programmer. This course starts you with TCP/IP network programming using the C# .NET socket library, and gets you writing real code fast.

2026 update — the Section 1 server code, verified on .NET 10. This course was originally recorded in 2014, and the core System.Net.Sockets API you're learning hasn't meaningfully changed since .NET 4.5 — that's exactly why it's still relevant over a decade later. In a new lecture, I open the original Section 1 server project, confirm it still builds in Visual Studio 2026, then use Claude to migrate that project live from .NET Framework 4.5.2 to .NET 10, with no code changes required. I then run it from VS Code with dotnet run and confirm it still accepts connections and echoes data back, exactly as it did in the original recordings. The point isn't that every project in the course has been rebuilt for .NET 10 — it's that the sockets concepts at the heart of this course are proven to still hold up, unchanged, on the current runtime. The updated Section 1 source is available on GitHub, linked directly in the lecture.

Each video in this course covers one essential concept of client-server socket programming and network communication. Ready-to-use C# code examples are supplied as downloadable Visual Studio solutions. After every few lectures, a demo shows the practical implementation of what was just described.

By the end of this course, you'll be able to build C# .NET software that sends and receives data over TCP/IP sockets, peer-to-peer, using async and await. You'll learn not just socket programming, but the same non-blocking I/O pattern used in production .NET networking code today.

Why this still matters in 2026. AI coding assistants can generate socket code that compiles and runs. What they're far less reliable at is explaining why a given pattern is correct, or helping you reason through a race condition in a multi-client server at 11pm. This course builds the actual mental model — sockets, ports, endpoints, blocking vs. non-blocking I/O — the part of the skill that doesn't get automated away and still shows up in networking interview questions.

Minimum upfront theory. Many courses pile up theory before the real code. This one doesn't — you'll be writing C# socket code within the first 15 minutes.

Who this course is for: developers and CS/university students with some C#, Java, or C++ experience who've never worked at the socket level. If you can write code but have never had to reason about ports, streams, and async network I/O, this closes that gap directly — with a project-based, WinForms-first approach instead of bare console demos.

Over 11,000 students have taken this course, many while working through university distributed-systems assignments or preparing for networking interview questions.

Who this course is for:

  • Take this course if you have some C# or Java programming experience
  • Network programming is a very interesting topic, if you're looking to study something off-beat in C# go for this course
  • Take this course only if you have never written code in any language (C#, C++, Java)