Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 5 & 6 UDP 서버/클라이언트 u-Network Design Lab 5.

Similar presentations


Presentation on theme: "Chapter 5 & 6 UDP 서버/클라이언트 u-Network Design Lab 5."— Presentation transcript:

1 Chapter 5 & 6 UDP 서버/클라이언트 u-Network Design Lab 5

2 Thread Synchronization
Need Synchronization. Why ? Share variable Int Balance = 100 Thread 2 Thread 1 u-Network Design Write Write Balance = Balance + 10; Balance = Balance +40;

3 Question 1 Modify ExCriticalSection example to use Event as thread synchronization mechanism. Important Functions CreateEvent(…) BOOL SetEvent (HANDLE hEvent) Refer Text Book pg u-Network Design

4 Sample Output Question 1
Without Thread Synchronization With Thread Synchronization u-Network Design

5 UDP server/client structure
socket() bind() recvfrom() sendto() closesocket() UDP server UDP client network u-Network Design

6 TCP vs UDP u-Network Design

7 TCP vs UDP TCP Frame UDP Frame Heavyweight Lightweight
u-Network Design TCP Frame UDP Frame Heavyweight Lightweight

8 Question 2 Modify FileReceiver.cpp & FileSender.cpp to UDP base.
[UDP Server] Client IP is connected. [UDP Server] Client IP is Sending file[test] 19 bytes. [UDP Server] Client IP is connected. [UDP Server] Client IP is Sending file[a.hwp] 123 bytes. [UDP Server] Client IP sent file[test] successfully. [UDP Server] Client IP sent file[a.hwp] successfully. u-Network Design

9 Question 3 Modify Lab4-Q3 to UDP base
Write a simple TCP User Authentication Program with multi-threading using _beginthreadex() and _endthreadex(). Client sends username to server. Server replies the member’s status back to client. Modify Lab4-Q3 to UDP base Do you still need multi-threading ? u-Network Design

10 Sample Output Question 3
Enter your username: dongseo …..Checking your status……. ====================== Username: dongseo Status: Member Enter your username: thread Username: thread Your status: Admin Enter your username: udesign Username : udesign Your status: Non-member u-Network Design

11 Thank you u-Network Design


Download ppt "Chapter 5 & 6 UDP 서버/클라이언트 u-Network Design Lab 5."

Similar presentations


Ads by Google