CREATED BY MUHAMMAD
UMAID
SOCKET PROGRAMMING
IN COMPUTER NETWORKING:
What is Socket Programming?
• Socket programming is a way of connecting two nodes on a network to
communicate with each other.
• It allows processes to communicate with each other, whether they’re on the
same machine or different machines on the network, by using sockets, which
are endpoints for communication.
2
How does Socket
programming work?
3
Socket():
Sockets are endpoints for communication between two machines over a network.
Bind():
The “bind()” function associates a socket with a specific network address(IP
address and port number).
Listen():
The “Listen()” function is used on the server side to set the socket in a passive
mode, indicating that it is ready to accept incoming connections.
4
Accept():
The “accept()” function is used to the server side to accept an incoming
connection request from the client.
Read/Write():
The “read()” and “write()” functions are used for reading from and writing data to sockets,
respectively.
5
Examples of Socket programming:
1. Web Servers and Clients:
2. Multiplayer Online Games:
3. Video and Voice Conferencing:
4. Instant Messaging and Chat Applications:
6
THANK YOU