SlideShare a Scribd company logo
Client Sockets vs Server Sockets
• Server Sockets
– A server socket is created using the python function
socket.socket()
– A sever socket needs to be bound to the specific IP
address and a port number
– Once bound on an IP and Port the socket has to listen
by making the call socket.listen()
– Listening is distinct which is what makes a socket a
Server Socket
– Server sockets accepts connections by calling the
socket.accept() method
Client Sockets vs Server Sockets
• Server Sockets
– Every return of accept() function gives the server
program a socket and an IP address pair of the
client.
– This client socket created for every client
connection can be either processed sequentially
or in a multithread way.
– This Python Example Client-Server program
exchanges messages on IPv4 addresses:
https://pythontic.com/modules/socket/client-server-example
Client Sockets vs Server Sockets
• Client Sockets
– Client Socket need not “explicitly” bind itself to the
IP/Port.
– However, the kernel will associate an ephemeral port
with the client socket and associate it to the local IP
on which the socket is created.
– The client socket need not listen for incoming
connections.
– Since the client socket is not listening for incoming
connections it need not accept any connections as
well.
Client Sockets vs Server Sockets
• Client Sockets
– Clients need not make below Python function calls
• socket.bind()
• socket.listen()
• socket.accept()
– Clients do make the following Python function
calls
• socket.Connect(), Socket.connectTo() (only for TCP
sockets)
• socket.recv()

More Related Content

What's hot (20)

PPT
Networking Java Socket Programming
Mousmi Pawar
 
PPT
Socket programming
chandramouligunnemeda
 
PDF
Python network programming
Learnbay Datascience
 
PPT
Networking & Socket Programming In Java
Ankur Agrawal
 
PDF
Chap 1 Network Theory & Java Overview
Ministry of Higher Education
 
PPT
Sockets
sivindia
 
PPT
Network programming in Java
Tushar B Kute
 
PPTX
Networking in Java
Tushar B Kute
 
PDF
Socket Programming
elliando dias
 
PPT
Easy Steps to implement UDP Server and Client Sockets
babak danyal
 
PPT
Socket programming-tutorial-sk
sureshkarthick37
 
PPT
java networking
Waheed Warraich
 
PPTX
Java 1
VidyaVarshini3
 
PPT
Networking in java
shravan kumar upadhayay
 
PPTX
Advance Java-Network Programming
ashok hirpara
 
PDF
Java networking programs socket based
Mukesh Tekwani
 
PPTX
Network programming in java - PPT
kamal kotecha
 
PPT
Java API: java.net.InetAddress
Sayak Sarkar
 
PDF
Java networking programs - theory
Mukesh Tekwani
 
PPTX
Socket programming
MdEmonRana
 
Networking Java Socket Programming
Mousmi Pawar
 
Socket programming
chandramouligunnemeda
 
Python network programming
Learnbay Datascience
 
Networking & Socket Programming In Java
Ankur Agrawal
 
Chap 1 Network Theory & Java Overview
Ministry of Higher Education
 
Sockets
sivindia
 
Network programming in Java
Tushar B Kute
 
Networking in Java
Tushar B Kute
 
Socket Programming
elliando dias
 
Easy Steps to implement UDP Server and Client Sockets
babak danyal
 
Socket programming-tutorial-sk
sureshkarthick37
 
java networking
Waheed Warraich
 
Networking in java
shravan kumar upadhayay
 
Advance Java-Network Programming
ashok hirpara
 
Java networking programs socket based
Mukesh Tekwani
 
Network programming in java - PPT
kamal kotecha
 
Java API: java.net.InetAddress
Sayak Sarkar
 
Java networking programs - theory
Mukesh Tekwani
 
Socket programming
MdEmonRana
 

Similar to Python Sockets (20)

PPTX
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
PPTX
python programming
keerthikaA8
 
PDF
Socket programming using java
UC San Diego
 
PPT
Python session 8
Navaneethan Naveen
 
PPTX
session6-Network Programming.pptx
SrinivasanG52
 
PPTX
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
PPTX
Basics of Socket Programming using python
NalinadeviKadiresan1
 
PPT
Network programming-Network for engineering
insdcn
 
PPT
Network Prog.ppt
EloOgardo
 
PPT
Sockets in unix
swtjerin4u
 
PPTX
CLIENT SERVER COMMUNICATION.pptx
VandanaGaria
 
PPT
Net Programming.ppt
EloAcubaOgardo
 
PPT
Socket Programming Tutorial
Jignesh Patel
 
PPT
Socket Programming Tutorial 1227317798640739 8
shanmuga priya
 
PPTX
Network programming using python
Ali Nezhad
 
PPTX
Byte Ordering - Unit 2.pptx
RockyBhai46825
 
PPTX
Socket programming
Anurag Tomar
 
PDF
Socket programming assignment
Ravi Gupta
 
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
python programming
keerthikaA8
 
Socket programming using java
UC San Diego
 
Python session 8
Navaneethan Naveen
 
session6-Network Programming.pptx
SrinivasanG52
 
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
Basics of Socket Programming using python
NalinadeviKadiresan1
 
Network programming-Network for engineering
insdcn
 
Network Prog.ppt
EloOgardo
 
Sockets in unix
swtjerin4u
 
CLIENT SERVER COMMUNICATION.pptx
VandanaGaria
 
Net Programming.ppt
EloAcubaOgardo
 
Socket Programming Tutorial
Jignesh Patel
 
Socket Programming Tutorial 1227317798640739 8
shanmuga priya
 
Network programming using python
Ali Nezhad
 
Byte Ordering - Unit 2.pptx
RockyBhai46825
 
Socket programming
Anurag Tomar
 
Socket programming assignment
Ravi Gupta
 
Ad

Recently uploaded (20)

PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Build a Custom Agent for Agentic Testing.pptx
klpathrudu
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Ad

Python Sockets

  • 1. Client Sockets vs Server Sockets • Server Sockets – A server socket is created using the python function socket.socket() – A sever socket needs to be bound to the specific IP address and a port number – Once bound on an IP and Port the socket has to listen by making the call socket.listen() – Listening is distinct which is what makes a socket a Server Socket – Server sockets accepts connections by calling the socket.accept() method
  • 2. Client Sockets vs Server Sockets • Server Sockets – Every return of accept() function gives the server program a socket and an IP address pair of the client. – This client socket created for every client connection can be either processed sequentially or in a multithread way. – This Python Example Client-Server program exchanges messages on IPv4 addresses: https://pythontic.com/modules/socket/client-server-example
  • 3. Client Sockets vs Server Sockets • Client Sockets – Client Socket need not “explicitly” bind itself to the IP/Port. – However, the kernel will associate an ephemeral port with the client socket and associate it to the local IP on which the socket is created. – The client socket need not listen for incoming connections. – Since the client socket is not listening for incoming connections it need not accept any connections as well.
  • 4. Client Sockets vs Server Sockets • Client Sockets – Clients need not make below Python function calls • socket.bind() • socket.listen() • socket.accept() – Clients do make the following Python function calls • socket.Connect(), Socket.connectTo() (only for TCP sockets) • socket.recv()