VOOZH about

URL: https://www.digitalocean.com/community/tutorials/understanding-sockets?comment=96867

⇱ Understanding Sockets | DigitalOcean


Understanding Sockets

Published on March 3, 2021
πŸ‘ Understanding Sockets

Introduction

Sockets are a way to enable inter-process communication between programs running on a server, or between programs running on separate servers. Communication between servers relies on network sockets, which use the Internet Protocol (IP) to encapsulate and handle sending and receiving data.

Network sockets on both clients and servers are referred to by their socket address. An address is a unique combination of a transport protocol like the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP), an IP address, and a port number.

In this tutorial you will learn about the following different types of sockets that are used for inter-process communication:

  • Stream sockets, which use TCP as their underlying transport protocol
  • Datagram sockets, which use UDP as their underlying transport protocol
  • Unix Domain Sockets, which use local files to send and receive data instead of network interfaces and IP packets.

In each section of this tutorial you will also learn how to enumerate the respective socket types on a Linux system. You’ll examine each type of socket using a variety of command line tools.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

High quality tutorial as always +1

This comment has been deleted

This comment has been deleted

This comment has been deleted

Good tutorial. Thank you

This comment has been deleted

This comment has been deleted

This comment has been deleted

I like this tutorial, but I simplest example β€œhow to send data to socket using Linux tools” and β€œhow to read data in socket using Linux tools” would be great for complete package of this tutorial

nicely written. Great tutorial. I love the hands on approach!

πŸ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow β€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Β© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.