Download presentation
Presentation is loading. Please wait.
1
Chapter 4 TCP 서버/클라이언트 u-Network Design Lab 3
2
Why Socket Programming?
“To build any Networked Application” WWW ( Internet Explorer , Firefox ) FTP (Filezilla) P2P (Limewire, Bit-torrent) u-Network Design
3
TCP Server – Client interaction
u-Network Design
4
Telephone Analogy Socket() – Endpoint for communication (Telephone)
Bind() - Assign a unique telephone number (Phone No) Listen() – Wait for a caller. Connect() - Dial a number. Accept() – Receive a call. Send(), Recv() – Talk. Close() – Hang up. u-Network Design
5
Question 1 Write a TCP Server Program to convert all received message from Client to UPPERCASE. Send the UPPERCASE message back to client. u-Network Design
6
Sample Output Question 1
u-Network Design
7
Question 2 Write a Body Mass Index (BMI) Calculator Server Program.
A useful tool to estimate a healthy body weight based on how tall a person is. Developed by Adolphe Quelet( ), and was known as the Quetelet Index. Client sends Weight(kg) and Height(m) to server Server return BMI value and weight status u-Network Design
8
Question 2 - continue BMI ( kg/m² ) = weight in kilograms —————————— height in meters² u-Network Design BMI Weight Status < 18.5 Underweight Normal Overweight >= 30 Obese
9
Sample Output Question 2
Enter your Height(cm): 175 Enter your Weight(kg): 68 ====================== Your BMI value: Your weight status: Normal Enter your Height(cm): 174 Enter your Weight(kg): 80 Your BMI value: Your weight status: Overweight ! u-Network Design
10
Question 3 Modify FileSender.cpp to display % of data has been sent.
20% data has been transferred successfully. 50% data has been transferred successfully. 78% data has been transferred successfully. 89% data has been transferred successfully. 100% data has been transferred successfully. File transfer success ! u-Network Design
11
Thank you u-Network Design
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.