How findingnothing85/systems-from-scratch works
Systems-From-Scratch is a series of progressively developed C socket-programming examples, culminating in a TCP file-transfer client/server. The core workflow sends a requested filename, reads the matching server-side file, and returns its size and contents for the client to save. Later server versions add per-client threads and then a worker queue. The graph emphasizes the sampled implementations; several intermediate versions appear in the tree but were not sampled, so their internal behavior is not inferred.
Main entry points: V11/fileclient.c Size-aware download · fileserver.c Size-header server · V1/fileclient.c Basic download · V4/fileclient.c Fixed-file download
Components 18
File client
- Basic download
V1/fileclient.c - Fixed-file download
V4/fileclient.c - Named-file download
V5/fileclient.c - Stream to file
V6/fileclient.c - Request filename
V8/fileclient.c - Size-aware download
V11/fileclient.c
File server
- Single-file server
V6/fileserver.c - Requested-file server
V10/fileserver.c - Size-header server
V11/fileserver.c - Thread-per-client
V12/fileserver.c - Queued server
V14/fileserver.c
Server concurrency
- Accept clients
V14/fileserver.c - Client queue
V14/fileserver.c - Worker threads
V14/fileserver.c
Other components
- User
- TCP connection
- Server files
- Downloaded file
Connections 28
- User → Size-aware download: requests file
- Size-aware download → TCP connection: sends filename
- TCP connection → Size-header server: delivers request
- Size-header server → Server files: reads requested file
- Size-header server → TCP connection: sends size and bytes
- TCP connection → Size-aware download: delivers response
- Size-aware download → Downloaded file: writes contents
- User → Request filename: provides filename
- Request filename → TCP connection: sends filename
- Requested-file server → Server files: reads requested file
- Requested-file server → TCP connection: sends file bytes
- Single-file server → Server files: reads configured file
- Single-file server → TCP connection: sends file bytes
- Stream to file → TCP connection: receives bytes
- Stream to file → Downloaded file: writes contents
- Basic download → TCP connection: receives bytes
- Basic download → Downloaded file: writes contents
- Fixed-file download → TCP connection: receives bytes
- Fixed-file download → Downloaded file: writes contents
- Named-file download → TCP connection: sends filename
- Named-file download → Downloaded file: writes contents
- Size-aware download → TCP connection: connects
- Queued server → Accept clients: accepts connections
- Accept clients → Client queue: enqueues clients
- Client queue → Worker threads: dispatches clients
- Worker threads → Queued server: handles request
- Thread-per-client → Server files: reads requested file
- Thread-per-client → TCP connection: sends size and bytes