How isweendyy/infotecs_test_task works
This repository implements a two-program C++ socket workflow backed by a shared dynamic library. The user enters a digit string in Program 1; it validates and transforms the string, hands it through a synchronized buffer for summing, then sends the sum to Program 2. Program 2 accepts connections, checks each sum through the library, and displays the result. Program 1 also retries connections. The check uses the number of digits in the sum and whether the sum is a nonzero multiple of 32. Relationships shown are based on the sampled source excerpts.
Main entry points: src/main.cpp Input Validation · src/main.cpp Socket Server · mylib.cpp String Transform
Components 11
Program 1
- Input Validation
program1/src/main.cpp - Shared Buffer
program1/src/main.cpp - Sum Processing
program1/src/main.cpp - Reconnect Loop
program1/src/main.cpp - Socket Client
program1/src/main.cpp
Shared Library
- String Transform
library/src/mylib.cpp - Digit Sum
library/src/mylib.cpp - Sum Check
library/src/mylib.cpp
Program 2
- Socket Server
program2/src/main.cpp - Result Display
program2/src/main.cpp
Other components
- User
Connections 9
- User → Input Validation: enters digits
program1/src/main.cpp - Input Validation → String Transform: calls transform
program1/src/main.cpp - Input Validation → Shared Buffer: writes string
program1/src/main.cpp - Shared Buffer → Sum Processing: signals data
program1/src/main.cpp - Sum Processing → Digit Sum: calls sum
program1/src/main.cpp - Reconnect Loop → Socket Client: retries connection
program1/src/main.cpp - Sum Processing → Socket Server: sends sum
program1/src/main.cpp - Socket Server → Sum Check: calls check
program2/src/main.cpp - Socket Server → Result Display: prints result
program2/src/main.cpp