-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTcpClient.uml
44 lines (35 loc) · 1.04 KB
/
TcpClient.uml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@startuml
hide footbox
title TcpClient Start Flow
participant User
participant TcpClient
participant Connector
participant Channel
participant EventLoop
participant Poller
participant TcpConnection
User-->EventLoop:new Eventloop instance
User-->TcpClient:new client(server_ip_Port)
note right:setCallback
User->TcpClient:connect()
TcpClient->Connector:connect():
note right:new connectFd
Connector->Channel:new channel(connectFd)
note right:setCallback
Connector->Channel:enableWriting
Channel ->EventLoop:updateChannel()
EventLoop->Poller:updateChannel()
note right:add new sockfd
User->EventLoop:loop()
EventLoop->Poller:poll(): monitor IO Events
Poller-->EventLoop:ActiveChannels
note left:accepted by server
EventLoop->Channel:handleEvent
note right:dispatchEventToCallback
Channel->Connector:handleWrite()
Connector->TcpClient:newConnection()
TcpClient-->TcpConnection:new a TcpConnection
TcpClient->TcpConnection:connectEstablished()
TcpConnection->Channel:enableReading()
note left:add fd to Poller
@enduml