Socket Programming
The role of socket programming in communicating between systems and contrast the protocols and
uses of TCP/IP sockets and Datagram sockets. A socket is one of the most fundamental technologies of
computer networking. Sockets allow applications to communicate using standard mechanisms built into
network hardware and operating systems.
Three socket types are available:
Stream sockets provide a bidirectional, reliable, sequenced, and unduplicated flow of message
data.
Datagram sockets support bidirectional data flow, but don't guarantee that the message data
is sequenced, reliable, or unduplicated.
Raw sockets give you access to the underlying communication protocols that support socket
abstractions.
Role of Socket programming
In a nutshell, a socket represents a single connection between exactly two pieces of software. A socket
provides a bidirectional communication endpoint for sending and receiving data with another socket.
Socket connections normally run between two different computers on a LAN or across the Internet, but
they can also be used for inter process communication on a single computer.
What do you need for socket communication?
Software applications that rely on the Internet and other computer networks continue to grow in
popularity.
The following software packages rely on sockets:
Web browsers, instant messaging applications, peer to peer file sharing systems.
UDP versus TCP
Contrast the protocols and uses of TCP/IP sockets and Datagram sockets
There are two types of Internet Protocol (IP) traffic.
• TCP or Transmission Control Protocol
• UDP or User Datagram Protocol.
TCP is connection oriented – once a connection is established, data can be sent bidirectional. UDP is a
simpler, connectionless Internet protocol. Multiple messages are sent as packets in chunks using UDP