plantuml
@startuml
!theme plain
skinparam BoxPadding 20
skinparam ParticipantPadding 20
participant "API\nClient" as client
participant "TCP\nConnection" as tcp
participant "API\nServer" as api
client -> tcp: TCP Handshake\n(SYN, SYN-ACK, ACK)
tcp -> api: Connection established
client -> api: GET /api/products/1\nConnection: keep-alive
api --> client: 200 OK\nConnection: keep-alive\nKeep-Alive: timeout=60, max=1000
note over tcp: Connection bleibt offen\n(kein TCP-Close)
client -> api: GET /api/products/2\n(same TCP connection)
api --> client: 200 OK\nConnection: keep-alive\nKeep-Alive: timeout=60, max=999
client -> api: POST /api/orders\n(same TCP connection)
api --> client: 201 Created\nConnection: keep-alive\nKeep-Alive: timeout=60, max=998
note over tcp: 60 Sekunden Idle-Time
note over tcp: Timeout erreicht\noder Client schließt
client -> tcp: TCP Close\n(FIN, ACK)
tcp -> api: Connection closed
note over client,api: Vorteile:\n- 3 Requests über 1 TCP-Connection\n- 2 TCP-Handshakes gespart\n- Reduzierte Latenz
@enduml