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

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 

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