What Are Sockets In Computer Networks?

ExploreEXPLORE THE CATALOGSupercharge your career with 700+ hands-on coursesView All CoursesPythonJavaJavaScriptCReactDockerVue JSRWeb DevDevOpsAWSC#LEARNING TOOLSExplore the industry's most complete learning platformCoursesLevel up your skillsSkill PathsAchieve learning goalsProjectsBuild real-world applicationsMock InterviewsNewAI-Powered interviewsPersonalized PathsGet the right resources for your goalsLEARN TO CODECheck out our beginner friendly courses.PricingFor BusinessResourcesNewsletterCurated insights on AI, Cloud & System DesignBlogFor developers, By developersFree CheatsheetsDownload handy guides for tech topicsAnswersTrusted answers to developer questionsGamesSharpen your skills with daily challengesSearchCoursesLog InJoin for freeWhat are sockets in computer networks?

Two processes that run on the same machine, or different machines, communicate through sockets. Sockets are seen as the end of the two-way communication between two processes; they allow processes to communicate with each other ​using a file descriptor and are commonly used in client-server applications that allow ​for ​communication between multiple applications.

How sockets are created

A socket is created by concatenating the IP number of a system and a software port number (not a ​hardware port number). This allows the process to know the address of the system (the IP address) and the address where the information needs to be sent (the port number). The IP number and the port number are separated by a ​:.

svg viewer

The diagram above shows two different applications communicating with one another through sockets.

In this diagram, application 1 sends the data to IP number 192.168.16.21 of application 2, port 100, while application 2 sends the data to ​IP number 192.168.1.1 of application 1, port ​80.

Relevant Answers

Explore Courses

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved

Tag » What Is A Socket In Networking