Skip to content

Architecture

Cisco edited this page Oct 4, 2025 · 2 revisions

Class diagram

Flow chart

---
config:
  layout: fixed
---
flowchart TD
    A["Server"] --> B(["<i>start()</i> loop"])
    B --> Sig{"SIGINT or *stop()*"} & C{"new connection ?"}
    Sig --> clean(["<i>cleanup()</i>"])
    clean --> stop["Stop"]
    C -- no --> F{"event on socket ?"}
    C -- yes --> D(["create socket and Client"])
    D -- subscribe EPOLLIN --> B
    F --- EPOLLOUT["EPOLLOUT"]
    EPOLLOUT --> H(["*send*"])
    F -- EPOLLIN --> G(["*recv*"])
    F -- EPOLLER
    EPOLLHUP
    EPOLLNVAL --> I("handle client disconnection")
    H -- update buffer if partially sent OR unsubscribe EPOLLOUT --> B
    G --> J(["handle new commands"])
    J --> K["CommandFactory"]
    K --> K1{"known Command ?"}
    K1 -- yes --> L["ICommand"]
    K1 -- no --> RH["ReplyHandler"]
    L --> M(["check_args()"])
    M --> RH & N(["execute()"])
    N --> RH
    RH --> RH1(["*process_response*"])
    RH1 --> RH2(["*send_response*"])
    RH2 -- subscribe EPOLLOUT ---> B
    A -..- Chan["Channel"] & Client["Client"]
    Client -..- Chan
    stop@{ shape: framed-circle}
    style A fill:#73BBF7, color:#000000
    style Sig stroke:#000000
    style K stroke:#2962FF,fill:#BBDEFB, color:#000000
    style L fill:#BBDEFB,color:#757575
    style RH stroke:#2962FF,color:#000000,fill:#BBDEFB
    style Chan fill:#BBDEFB, color:#000000
    style Client fill:#BBDEFB, color:#000000
Loading

Clone this wiki locally