SlideShare a Scribd company logo
2
Most read
5
Most read
8
Most read
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
• What are sockets?
• How to achieve Socket Programming in Python?
• Servers and Clients
• Client-Server Communication
• Transferring Python Objects
www.edureka.co/python
www.edureka.co/python
• Sockets are interior endpoints built for sending
and receiving data
• A single network will have two sockets
• Sockets are a combination of an IP address and a
Port
www.edureka.co/python
Protocol Port Number Python Library Function
HTTP 80 httplib, urllib,xmlrpclib Web pages
FTP 20 ftplib, urllib File transfers
NNTP 119 nntplib Unsent news
SMTP 25 smtplib Sending email
Telnet 23 telnetlib Command lines
POP3 110 poplib Fetching email
Gopher 70 gopherlib Document transfer
Common port numbers and the related protocols
Common Port Numbers
www.edureka.co/python
www.edureka.co/python
• Import the socket module or framework
• This module consists of built-in methods that are
required for creating sockets and help them associate
with each other
www.edureka.co/python
Methods Description
socket.socket()
Used to create sockets (required on both server as well as
client ends to create sockets)
socket.accept()
Used to accept a connection. It returns a pair of values (conn,
address)
socket.bind() Used to bind to the address that is specified as a parameter
socket.close() Used to bind to the address that is specified as a parameter
socket.connect() Used to mark the socket as closed
socket.listen()
Used to connect to a remote address specified as the
parameter
Important methods of the socket module
www.edureka.co/python
www.edureka.co/python
www.edureka.co/python
• Either a program, a computer, or a device
• Devoted to managing network resources
• Can be on the same device or computer or local or even
remote
Server
Client
• Computer or software that receives information or services
• Clients requests for services from servers
• The best example is a web browser
www.edureka.co/python
www.edureka.co/python
www.edureka.co/python
• Socket Programming in Python also
allows you to transfer Python objects
such as sets, tuples, dictionaries, etc.
• To achieve this, you need to import
the pickle module.
www.edureka.co/python
Copyright © 2019, edureka and/or its affiliates. All rights reserved.
www.edureka.co/python
Ad

Recommended

PDF
Network programming Using Python
Karim Sonbol
 
PPT
THE COMPLETE OSI MODEL
AMIT GUPTA
 
PPT
Java Networking
Sunil OS
 
PPTX
Communication in client server system.pptx
MSivani
 
PDF
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 
PPTX
Addressing in networking (IP,MAC,Port addressing)
Geethu Jose
 
PPTX
Tcp/ip server sockets
rajshreemuthiah
 
PPTX
Socket programming in python
Vignesh Suresh
 
PDF
Socket Programming In Python
didip
 
PPTX
File handling in Python
Megha V
 
PDF
Python network programming
Learnbay Datascience
 
PPTX
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
PPT
Java interfaces
Raja Sekhar
 
PDF
How to use Map() Filter() and Reduce() functions in Python | Edureka
Edureka!
 
PPT
Ppt of socket
Amandeep Kaur
 
PPTX
Socket Programming
VisualBee.com
 
PDF
Methods in Java
Jussi Pohjolainen
 
PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Edureka!
 
PDF
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
PDF
Python File Handling | File Operations in Python | Learn python programming |...
Edureka!
 
PDF
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
PPTX
Chapter 3 servlet & jsp
Jafar Nesargi
 
PPT
SQLITE Android
Sourabh Sahu
 
PPTX
Python Functions
Mohammed Sikander
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
PDF
Socket programming
NemiRathore
 

More Related Content

What's hot (20)

PPTX
Socket programming in python
Vignesh Suresh
 
PDF
Socket Programming In Python
didip
 
PPTX
File handling in Python
Megha V
 
PDF
Python network programming
Learnbay Datascience
 
PPTX
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
PPT
Java interfaces
Raja Sekhar
 
PDF
How to use Map() Filter() and Reduce() functions in Python | Edureka
Edureka!
 
PPT
Ppt of socket
Amandeep Kaur
 
PPTX
Socket Programming
VisualBee.com
 
PDF
Methods in Java
Jussi Pohjolainen
 
PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Edureka!
 
PDF
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
PDF
Python File Handling | File Operations in Python | Learn python programming |...
Edureka!
 
PDF
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
PPTX
Chapter 3 servlet & jsp
Jafar Nesargi
 
PPT
SQLITE Android
Sourabh Sahu
 
PPTX
Python Functions
Mohammed Sikander
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
Socket programming in python
Vignesh Suresh
 
Socket Programming In Python
didip
 
File handling in Python
Megha V
 
Python network programming
Learnbay Datascience
 
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
Java interfaces
Raja Sekhar
 
How to use Map() Filter() and Reduce() functions in Python | Edureka
Edureka!
 
Ppt of socket
Amandeep Kaur
 
Socket Programming
VisualBee.com
 
Methods in Java
Jussi Pohjolainen
 
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Edureka!
 
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
Python File Handling | File Operations in Python | Learn python programming |...
Edureka!
 
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
Chapter 3 servlet & jsp
Jafar Nesargi
 
SQLITE Android
Sourabh Sahu
 
Python Functions
Mohammed Sikander
 
Need of object oriented programming
Amar Jukuntla
 

Similar to What is Socket Programming in Python | Edureka (20)

PDF
Socket programming
NemiRathore
 
PPTX
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
PPTX
Network programming using python
Ali Nezhad
 
PPTX
Networking in python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
PDF
Socket programming-in-python
Yuvaraja Ravi
 
PPTX
python programming
keerthikaA8
 
PPT
Python session 8
Navaneethan Naveen
 
PDF
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
PPTX
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
PDF
Hacking (with) WebSockets
Sergey Shekyan
 
PPTX
Pythonlearn-12-HTTP- Network Programming
ssusere5ddd6
 
PPTX
session6-Network Programming.pptx
SrinivasanG52
 
PPT
Socket Programming_theory.ppt
mdrobinhossain4
 
PPTX
Basics of Socket Programming using python
NalinadeviKadiresan1
 
PDF
network programming lab manuaal in this file
shivani158351
 
PPT
Socket programming
Divya Sharma
 
PPTX
CLIENT SERVER COMMUNICATION.pptx
VandanaGaria
 
PDF
Socket programming
Rajivarnan (Rajiv)
 
PDF
Async I/O in Python
Python Ireland
 
Socket programming
NemiRathore
 
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
Network programming using python
Ali Nezhad
 
Socket programming-in-python
Yuvaraja Ravi
 
python programming
keerthikaA8
 
Python session 8
Navaneethan Naveen
 
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Network Programming-Python-13-8-2023.pptx
ssuser23035c
 
Hacking (with) WebSockets
Sergey Shekyan
 
Pythonlearn-12-HTTP- Network Programming
ssusere5ddd6
 
session6-Network Programming.pptx
SrinivasanG52
 
Socket Programming_theory.ppt
mdrobinhossain4
 
Basics of Socket Programming using python
NalinadeviKadiresan1
 
network programming lab manuaal in this file
shivani158351
 
Socket programming
Divya Sharma
 
CLIENT SERVER COMMUNICATION.pptx
VandanaGaria
 
Socket programming
Rajivarnan (Rajiv)
 
Async I/O in Python
Python Ireland
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
PDF
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
PPTX
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
PPTX
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PDF
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
The Growing Value and Application of FME & GenAI
Safe Software
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 

What is Socket Programming in Python | Edureka

  • 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  • 2. • What are sockets? • How to achieve Socket Programming in Python? • Servers and Clients • Client-Server Communication • Transferring Python Objects www.edureka.co/python
  • 4. • Sockets are interior endpoints built for sending and receiving data • A single network will have two sockets • Sockets are a combination of an IP address and a Port www.edureka.co/python
  • 5. Protocol Port Number Python Library Function HTTP 80 httplib, urllib,xmlrpclib Web pages FTP 20 ftplib, urllib File transfers NNTP 119 nntplib Unsent news SMTP 25 smtplib Sending email Telnet 23 telnetlib Command lines POP3 110 poplib Fetching email Gopher 70 gopherlib Document transfer Common port numbers and the related protocols Common Port Numbers www.edureka.co/python
  • 7. • Import the socket module or framework • This module consists of built-in methods that are required for creating sockets and help them associate with each other www.edureka.co/python
  • 8. Methods Description socket.socket() Used to create sockets (required on both server as well as client ends to create sockets) socket.accept() Used to accept a connection. It returns a pair of values (conn, address) socket.bind() Used to bind to the address that is specified as a parameter socket.close() Used to bind to the address that is specified as a parameter socket.connect() Used to mark the socket as closed socket.listen() Used to connect to a remote address specified as the parameter Important methods of the socket module www.edureka.co/python
  • 10. www.edureka.co/python • Either a program, a computer, or a device • Devoted to managing network resources • Can be on the same device or computer or local or even remote Server Client • Computer or software that receives information or services • Clients requests for services from servers • The best example is a web browser www.edureka.co/python
  • 13. • Socket Programming in Python also allows you to transfer Python objects such as sets, tuples, dictionaries, etc. • To achieve this, you need to import the pickle module. www.edureka.co/python
  • 14. Copyright © 2019, edureka and/or its affiliates. All rights reserved.