SlideShare a Scribd company logo
1 of 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

More Related Content

Similar to 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 to 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
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+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@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

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