CY350

Socket Programming

Creating Network Applications
Published

February 4, 2026

Preparation

  • \(2.7\) Socket Programming: Creating Network Applications

Lesson Objectives

  • Define a socket as the programming interface between application and transport layer
  • Explain why network data must be encoded as bytes rather than transmitted as string
  • Identify the differences between TCP and UDP sockets
  • Implement a basic HTTP server using Python socket library

Exercise

  • Use netcat to listen on a port and send messages
  • Write an HTTP server that responds to basic GET requests
  • Use curl to test your server

Reuse

CC BY-NC-SA 4.0
 

© 2026 United States Military Academy