SlideShare a Scribd company logo
2
Most read
3
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

More Related Content

PPTX
Python - Data Structures
NR Computer Learning Center
 
PDF
Network programming Using Python
Karim Sonbol
 
PDF
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 
PPTX
Addressing in networking (IP,MAC,Port addressing)
Geethu Jose
 
DOC
vishal_sharma: python email sending software
vishal sharma
 
PPTX
Arp and rarp
Nita Dalla
 
PPTX
Internetworking
Raghu nath
 
Python - Data Structures
NR Computer Learning Center
 
Network programming Using Python
Karim Sonbol
 
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 
Addressing in networking (IP,MAC,Port addressing)
Geethu Jose
 
vishal_sharma: python email sending software
vishal sharma
 
Arp and rarp
Nita Dalla
 
Internetworking
Raghu nath
 

What's hot (20)

PPTX
Socket programming in python
Vignesh Suresh
 
PDF
Socket Programming with Python
GLC Networks
 
PPT
Socket Programming
CEC Landran
 
PPT
Socket Programming Tutorial
Jignesh Patel
 
PPT
TCP/IP Network ppt
extraganesh
 
PPT
Socket programming
harsh_bca06
 
PPTX
Socket Programming
VisualBee.com
 
PDF
Socket programming using C
Ajit Nayak
 
PPT
Internet control message protocol
asimnawaz54
 
PPTX
Http protocol
Arpita Naik
 
PPTX
HTTP Protocol Basic
Chuong Mai
 
PPT
Socket programming
chandramouligunnemeda
 
ODP
Https presentation
patel jatin
 
PPT
Network security cryptography ppt
Thushara92
 
PPTX
Transport layer protocol
N.Jagadish Kumar
 
PPTX
Application Layer
Dr Shashikant Athawale
 
PPTX
Introduction of tcp, ip & udp
rahul kundu
 
PPT
Dns
Sanoj Kumar
 
PPT
Secure shell ppt
sravya raju
 
Socket programming in python
Vignesh Suresh
 
Socket Programming with Python
GLC Networks
 
Socket Programming
CEC Landran
 
Socket Programming Tutorial
Jignesh Patel
 
TCP/IP Network ppt
extraganesh
 
Socket programming
harsh_bca06
 
Socket Programming
VisualBee.com
 
Socket programming using C
Ajit Nayak
 
Internet control message protocol
asimnawaz54
 
Http protocol
Arpita Naik
 
HTTP Protocol Basic
Chuong Mai
 
Socket programming
chandramouligunnemeda
 
Https presentation
patel jatin
 
Network security cryptography ppt
Thushara92
 
Transport layer protocol
N.Jagadish Kumar
 
Application Layer
Dr Shashikant Athawale
 
Introduction of tcp, ip & udp
rahul kundu
 
Secure shell ppt
sravya raju
 
Ad

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

PDF
Socket programming
NemiRathore
 
PPTX
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
PDF
Python network programming
Learnbay Datascience
 
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
 
PDF
Socket Programming In Python
didip
 
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
 
Socket programming
NemiRathore
 
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
Maulik Borsaniya
 
Python network programming
Learnbay Datascience
 
Network programming using python
Ali Nezhad
 
Socket programming-in-python
Yuvaraja Ravi
 
python programming
keerthikaA8
 
Python session 8
Navaneethan Naveen
 
اسلاید اول جلسه یازدهم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Socket Programming In Python
didip
 
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
 
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!
 

Recently uploaded (20)

PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PPT
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PPTX
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 

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.