Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Processing Design

Similar presentations


Presentation on theme: "Windows Processing Design"— Presentation transcript:

1 Windows Processing Design
Chapter 9 網路主從式架構應用 Internet 元件介紹 Client 與 Server 架構 TCP 之Client/Server的應用 結論 Hung-Hsiang Wu Windows Processing Design

2 Windows Processing Design
Internet 元件介紹之一 TCP/IP 網路協定 UDP (User Datagram Protocol) TCP (Transmission Control Protocol) TNMUDP 、TClientSocket、TServerSocket Properties – Name、Port、Active Events – OnAccept、OnClientConnect… Hung-Hsiang Wu Windows Processing Design

3 Windows Processing Design
Internet 元件介紹之二 Application TClientSocket TServerSocket TNMUDP TCP UDP IP Hung-Hsiang Wu Windows Processing Design

4 Windows Processing Design
Client 與 Server 架構之一 Request Response Port Protocol X Any Hung-Hsiang Wu Windows Processing Design

5 Windows Processing Design
Client 與 Server 架構之二 Listen Connect Accept OnClientConnect Event OnAccept Event OnConnecting Event Send Receive OnClientRead Event Hung-Hsiang Wu Windows Processing Design

6 TCP 之Client/Server的應用
設定 TServerSocket 的屬性 Server->Active; 啟動等待 Socket->ReceiveText(); 接收資料 設定 Event OnAccept (接受Client 的連接) OnClientConnect (連自Client 的連接要求) OnClientDisconnect (Client中斷連結) OnClientRead (讀取Client 端傳送資料) OnListen (Server 等待事件) Hung-Hsiang Wu Windows Processing Design

7 TCP 之Client/Server的應用(cont.)
設定 TClientSocket 的屬性 Client->Active = true; 啟動連結 Client->Socket->SendText(“ABC”); 傳送字串 設定 Event OnConnect (連結中的事件) OnConnecting (嘗試連結的事件) OnDisconnect (連結中斷) Hung-Hsiang Wu Windows Processing Design

8 Windows Processing Design
結論 利用 TClientSocket 與 TserverSocket 來設計一個簡單的Client/Server 架構 Hung-Hsiang Wu Windows Processing Design


Download ppt "Windows Processing Design"

Similar presentations


Ads by Google