Socket in Computer Network Last Updated : 12 Jul, 2025 Suggest changes Share Like Article Like Report A socket is one endpoint of a two way communication link between two programs running on the network. The socket mechanism provides a means of inter-process communication (IPC) by establishing named contact points between which the communication take place. How Sockets Work in Computer NetworksLike 'Pipe' is used to create pipes and sockets is created using 'socket' system call. The socket provides bidirectional FIFO Communication facility over the network.A socket connecting to the network is created at each end of the communication.Each socket has a specific address.This address is composed of an IP address and a port number.Socket are generally employed in client server applications.The server creates a socket, attaches it to a network port addresses then waits for the client to contact it.The client creates a socket and then attempts to connect to the server socket.When the connection is established, transfer of data takes place. Types of SocketsThere are two types of Sockets:Datagram Socket : This is a type of network which has connection less point for sending and receiving packets. It is similar to mailbox. The letters (data) posted into the box are collected and delivered (transmitted) to a letterbox (receiving socket). Stream Socket In Computer operating system, a stream socket is type of interprocess communications socket or network socket which provides a connection-oriented, sequenced, and unique flow of data without record boundaries with well defined mechanisms for creating and destroying connections and for detecting errors. It is similar to phone. A connection is established between the phones (two ends) and a conversation (transfer of data) takes place.Common Function Calls in Socket ProgrammingHere is a summary of the common function calls used in socket programming:Function Call Description Socket()To create a socketBind()It's a socket identification like a telephone number to contactListen()Ready to receive a connection Connect()Ready to act as a sender Accept()Confirmation, it is like accepting to receive a call from a sender Write()To send data Read()To receive data Close()To close a connection H harleenk_99 Follow Explore Computer Network BasicsBasics of Computer Networking4 min readTypes of Computer Networks6 min readIntroduction to Internet10 min readNetwork Devices3 min readWhat is OSI Model? - Layers of OSI Model11 min readTCP/IP Model6 min readDifference Between OSI Model and TCP/IP Model2 min readPhysical LayerPhysical Layer in OSI Model3 min readTypes of Network Topology9 min readTransmission Modes in Computer Networks (Simplex, Half-Duplex and Full-Duplex)3 min readTransmission Media in Computer Networks7 min readData Link LayerData Link Layer in OSI Model4 min readSwitching | Computer Networks2 min readVirtual LAN (VLAN)3 min readFraming in Data Link Layer3 min readError Control in Data Link Layer3 min readFlow Control in Data Link Layer3 min readPiggybacking in Computer Networks2 min readNetwork LayerNetwork Layer in OSI Model3 min readIntroduction of Classful IP Addressing7 min readClassless Addressing in IP Addressing7 min readWhat is an IP Address?11 min readIPv4 Datagram Header4 min readDifference Between IPv4 and IPv63 min readPublic and Private IP addresses4 min readIntroduction To Subnetting5 min readWhat is Routing?10 min readNetwork Layer Protocols9 min readTransport LayerTransport Layer in OSI Model5 min readTransport Layer Protocols9 min readWhat is TCP (Transmission Control Protocol)?5 min readUser Datagram Protocol (UDP)5 min readSession Layer & Presentation LayerSession Layer in OSI model6 min readPresentation Layer in OSI model4 min readSecure Socket Layer (SSL)10 min readPPTP Full Form - Point-to-Point Tunneling Protocol5 min readMultipurpose Internet Mail Extension (MIME) Protocol4 min readApplication LayerApplication Layer in OSI Model5 min readClient-Server Model3 min readWorld Wide Web (WWW)6 min readIntroduction to Electronic Mail4 min readWhat is a Content Distribution Network and how does it work?4 min readProtocols in Application Layer4 min readAdvanced TopicsWhat is Network Security?7 min readComputer Network | Quality of Service and Multimedia5 min readAuthentication in Computer Network3 min readEncryption, Its Algorithms And Its Future10 min readIntroduction of Firewall in Computer Network7 min readMAC Filtering in Computer Network4 min readWi-Fi Standards Explained2 min readWhat is Bluetooth?6 min readGenerations of wireless communication2 min readCloud Networking4 min readPracticeTop 50 Plus Networking Interview Questions and Answers for 202415+ min readTop 50 TCP/IP Interview Questions and Answers 202515+ min readNetwork Fundamentals Interview Questions - Computer Networks15+ min readLast Minute Notes for Computer Networks14 min readComputer Network - Cheat Sheet15+ min read Article Tags : Computer Networks GATE CS Write From Home Like