SlideShare una empresa de Scribd logo
1 de 19
Huma Chaudhry                              ME111012

       Nima bahrami                               ME101004
                                                         1
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
Some Important
                                                     Terms:

                                                      socket
               Stream:
                                                            a host-local,
               Listen: Server does the
               Listening at a port for                 application-created,
               you                                    OS-controlled interface
               Port: 65535 ports                         (a “door”) into which
                                                        application process can
               Socket: a door
               between application                           both send and
               process and end-end-                   receive messages to/from
               transport protocol                         another application
               (UCP or TCP)                                     process
               Try-Catch

Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   2
Overview of Client/Server interaction
                TCP
    create socket,
    port=xyz, for
    incoming request:
  welcomeSocket =
     ServerSocket()
                         TCP                create socket,
 wait for incoming
 connection request connection   setup      connect to hostid, port=x
                                         clientSocket =
 connectionSocket =
 welcomeSocket.accept()                         Socket()

                                           send request using
    read request from                      clientSocket
    connectionSocket

     write reply to
     connectionSocket                      read reply from
                                           clientSocket
 close
 connectionSocket                        Close req
                                  3      clientSocket
                                           Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
controlled by
     controlled by                                           process     application
       application              process
                                                                         developer
        developer               socket                        socket
                               TCP with                      TCP with    controlled by
    controlled by
                                                             buffers,    operating
       operating               buffers,           internet               system
          system               variables                     variables

                                host or                      host or
                                server                       server
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)       4
Networking:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   5
Sneak Peak into the Code



                                                      Server Side

                                                      Client Side




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   6
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)




Socket programming (server)
Passive Listening:




                     7
Socket programming (server)
                   Streams of Data to carry data to/from Client:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   8
Socket programming (server)
                     Receiving File from Client:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)    9
Socket programming (server)
             Client Terminating Connection:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   10
Socket programming (server)
             Server Terminating Connection:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   11
Client Request for Connection:-




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   12
Socket programming: Client
   Client reaching out to Server




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   13
Client Communication with Server:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   14
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   15
Client Side:
                                      Client Sending File




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   16
Client Closing Connection:




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   17
Thanks to TCP




Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   18
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)   19

Más contenido relacionado

Similar a TCP file upload server client example

Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
Kavita Sharma
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
secunderbadtirumalgi
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
sanjoysanyal
 

Similar a TCP file upload server client example (20)

Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
 
Ch2 the application layer protocols_ftp_telnet_samba_dhcp_4
Ch2 the application layer protocols_ftp_telnet_samba_dhcp_4Ch2 the application layer protocols_ftp_telnet_samba_dhcp_4
Ch2 the application layer protocols_ftp_telnet_samba_dhcp_4
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
Unit 6 : Application Layer
Unit 6 : Application LayerUnit 6 : Application Layer
Unit 6 : Application Layer
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
009577496.pdf
009577496.pdf009577496.pdf
009577496.pdf
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Internet technology unit 5
Internet technology unit 5Internet technology unit 5
Internet technology unit 5
 
Np unit iii
Np unit iiiNp unit iii
Np unit iii
 
Sockets
SocketsSockets
Sockets
 
Think async
Think asyncThink async
Think async
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
System and network administration network services
System and network administration network servicesSystem and network administration network services
System and network administration network services
 
Socket programming
Socket programmingSocket programming
Socket programming
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
 
ip1clientserver model
 ip1clientserver model ip1clientserver model
ip1clientserver model
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

TCP file upload server client example

  • 1. Huma Chaudhry ME111012 Nima bahrami ME101004 1 Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
  • 2. Some Important Terms: socket Stream: a host-local, Listen: Server does the Listening at a port for application-created, you OS-controlled interface Port: 65535 ports (a “door”) into which application process can Socket: a door between application both send and process and end-end- receive messages to/from transport protocol another application (UCP or TCP) process Try-Catch Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 2
  • 3. Overview of Client/Server interaction TCP create socket, port=xyz, for incoming request: welcomeSocket = ServerSocket() TCP create socket, wait for incoming connection request connection setup connect to hostid, port=x clientSocket = connectionSocket = welcomeSocket.accept() Socket() send request using read request from clientSocket connectionSocket write reply to connectionSocket read reply from clientSocket close connectionSocket Close req 3 clientSocket Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
  • 4. controlled by controlled by process application application process developer developer socket socket TCP with TCP with controlled by controlled by buffers, operating operating buffers, internet system system variables variables host or host or server server Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 4
  • 6. Sneak Peak into the Code Server Side Client Side Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 6
  • 7. Huma Chaudhry(ME111012), Nima Bahrami(ME101004) Socket programming (server) Passive Listening: 7
  • 8. Socket programming (server) Streams of Data to carry data to/from Client: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 8
  • 9. Socket programming (server) Receiving File from Client: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 9
  • 10. Socket programming (server) Client Terminating Connection: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 10
  • 11. Socket programming (server) Server Terminating Connection: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 11
  • 12. Client Request for Connection:- Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 12
  • 13. Socket programming: Client Client reaching out to Server Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 13
  • 14. Client Communication with Server: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 14
  • 15. Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 15
  • 16. Client Side: Client Sending File Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 16
  • 17. Client Closing Connection: Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 17
  • 18. Thanks to TCP Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 18
  • 19. Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 19