Client and Server Roles in a Network Request
A client initiates a request under a protocol. A server receives compatible requests and supplies responses or another documented outcome.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace one exchange
An application asks a service for a document by its identifier. The service locates the document and returns its content or an absent result. Function contracts provide a local analogue for expected inputs and outputs.
Separate role from hardware
A program can serve incoming requests while acting as a client of a storage service. Name the roles for each connection before interpreting timeouts. See unknown outcomes after a timeout.[1][2]
Identify roles within one exchange
A catalogue service can receive an item request from a browser and make its own request to a price service. In the first exchange it acts as server, and in the second it acts as client. Those roles are properties of connections or messages within the design. See a request and reply.
Browser → catalogue: catalogue is server
Catalogue → price service: catalogue is client
Price response can be used to build the browser's response
Distinguish upstream and downstream latency
A slow browser response may include time the catalogue spent waiting for prices. Record which endpoint received each request and which reply was awaited. Include one case where the catalogue can answer without its downstream dependency.