Socket programming for online game development

This course covers the core of TCP/IP network programming required for online game development, with a practical, hands-on focus. You will learn step by step, starting with the basic principles of sockets and progressing through client-server architecture design to implementing a game framework using a self-developed network library. Topics covered: Basic network concepts and how TCP/IP works TCP programming using the Socket API Packet protocol design and implementation of transmission structures Development of a client/server-based game framework Optimization and practical tips needed for actual online game development Notes: The course is conducted on Windows using Visual Studio. Although it uses the standard bsd socket API, there are slight differences from Unix-based operating systems. IOCP and Overlapped I/O are not covered.

(5.0) 8 reviews

63 learners

Level Intermediate

Course period Unlimited

winsock
winsock
game-programming
game-programming
bsd-sockets
bsd-sockets
tcpip
tcpip
windows-programming
windows-programming
winsock
winsock
game-programming
game-programming
bsd-sockets
bsd-sockets
tcpip
tcpip
windows-programming
windows-programming

Reviews from Early Learners

5.0

5.0

영환

64% enrolled

This is such an informative lecture. After watching it, I’m practicing by typing out each line of code from scratch and reviewing the parts I don’t understand well by rewatching the lecture. It’s been a great help. Thank you.

5.0

wolfclaw4

64% enrolled

I hope all job seekers listen to this.

5.0

아데니아

100% enrolled

The comprehensive lecture materials provided help me understand the content more deeply.

What you will gain after the course

  • Understanding and Applications of TCP/IP

  • Socket programming

  • Network Programming

  • Online game server programming

Have you ever imagined players connecting to a game server you created? Now let's build the server and client for an online game ourselves.

Have you ever wondered how multiplayer games or MMOs with large numbers of players work? Have you ever wanted to add networking to a game you made yourself and support an online mode?
If so, this course can help you.
If you want to write code that simply sends and receives data over the internet, it is easy to implement using the socket API. However, code that merely sends and receives data is somewhat different from network programming in game development. This course goes beyond simply using APIs to explain how to write practical network code and apply it to online games based on the client/server model.

What you’ll learn

1. Network Basics - How the Internet Is Structured

We introduce the OSI seven-layer model and the TCP/IP four-layer model and explain how these concepts are integrated into the internet.

2. Network Basics - TCP/IP

Learn the technical operating principles of TCP/IP, the main protocol suite that makes up the Internet. We explain the structure of TCP and IP headers, TCP sequence numbers and acknowledgment system, connection establishment using the three-way handshake, and connection termination using the four-way handshake.

3. Overview of Winsock Programming

We introduce Winsock, the socket API implementation for Windows.
We explain the differences between Winsock and Unix-like socket APIs. We preview the functions and features primarily used in Winsock programming.

4. Connections (listen/accept/connect)

Write the initial client and server code using the APIs that receive connection requests and make connection requests.


5. send / recv

We actually exchange data using the send() and recv() functions. At this point, we will only cover blocking mode sockets.

6. non-blocking socket

Blocking mode sockets are easy to use, but they are not suitable for real-time games. This section explains how to write network code that can be used in actual game programming with non-blocking sockets.

7. Send-Buffer / Recv-Buffer

To handle exceptional situations, you cannot rely solely on the socket’s basic functionality. We will implement Recv-Buffer and Send-Buffer to prepare for exceptional situations that may occur due to the characteristics of TCP. This is a core feature in developing a full-fledged network library.

8. Design and Implementation of a Network Library

We will design and implement a network library that can be shared by both game servers and clients. This allows us to jump more than two levels from simply implementing send-and-receive functionality using the socket API to developing an actual product.

9. Network Library Packaging

To move beyond simply copying and pasting code and achieve true modularization, the components must be isolated at the binary level. This introduces a method of separating the network library code into a DLL to clearly establish the boundary between the content layer and the network layer. This can be a great help in actual product development.

10. Network Game Demo

Although it is not a complete game, we will implement the essential elements for developing an online game. Using the network library created in the previous lecture, we will create a simple demo in which multiple clients connect to a server and synchronize movement.

11. Tips for Performance

We introduce technologies for improving network bandwidth and server performance efficiency in online games. We also clear up some misconceptions about UDP vs. TCP.

Notes Before Enrolling

Practice Environment

  • Operating system and version (OS): Windows 10/11

  • Tool used: Visual Studio 2022


Learning Materials

  • PDF provided

  • Source code provided via attached files

Prerequisite Knowledge

Important Notes

  • The course uses the Winsock API in a Windows environment.

  • We cover common socket API techniques that can also be used on Unix-like systems, including Linux, but the hands-on practice environment is Windows + Visual Studio 2022.

  • Technologies such as Overlapped I/O and IOCP (I/O Completion Port), apart from the standard socket API, are not covered.


Recommended for
these people

Who is this course right for?

  • A developer who wants to implement a game server/client network architecture directly

  • Those who want to learn core networking technologies such as TCP/IP and sockets through hands-on practice

Need to know before starting?

  • C/C++

  • windows programming

Hello
This is megayuchi

Inflearn Verified

Career Verified

3,441

Learners

117

Reviews

25

Answers

4.9

Rating

11

Courses

프로그래머

C++,x86/x64 ASM, DirectX9/11/12, Metal, OpenGL, CUDA, win32, winsock/bsd socket

 

인프런 강의

D3D12프로그래밍 기초편 - https://inf.run/7gJhS

D3D12프로그래밍 기초플러스 - https://inf.run/itHDW

DirectX Raytracing 프로그래밍 - https://inf.run/cQqx7

Windows System 프로그래밍 - https://inf.run/AwfCv

Windows Debugging Tips - https://inf.run/zL7E4

 

Blog : https://megayuchi.com

Youtube : https://youtube.com/megayuchi

LinkedIn : https://www.linkedin.com/in/megayuchi/

 

 

More
Published: 
Last updated: 

Reviews

All

8 reviews

5.0

8 reviews

  • thekim122050님의 프로필 이미지
    thekim122050

    Reviews 7

    Average Rating 4.4

    5

    64% enrolled

    This is such an informative lecture. After watching it, I’m practicing by typing out each line of code from scratch and reviewing the parts I don’t understand well by rewatching the lecture. It’s been a great help. Thank you.

    • chs931143588님의 프로필 이미지
      chs931143588

      Reviews 4

      Average Rating 5.0

      5

      100% enrolled

      The comprehensive lecture materials provided help me understand the content more deeply.

      • wolfclaw43527님의 프로필 이미지
        wolfclaw43527

        Reviews 1

        Average Rating 5.0

        5

        64% enrolled

        I hope all job seekers listen to this.

        • alstjr123qwe3562님의 프로필 이미지
          alstjr123qwe3562

          Reviews 1

          Average Rating 5.0

          5

          64% enrolled

          • cov10135743님의 프로필 이미지
            cov10135743

            Reviews 9

            Average Rating 5.0

            5

            36% enrolled

            megayuchi's other courses

            Check out other courses by the instructor!

            Similar courses

            Explore other courses in the same field!

            $152.90