Building a Server & Client socket, using the Socket module, and making them communicate over their respective IPs.
ParentFolder
|
|-server_test.py
|-crc_input.py
|-socket_utils.py
|-streamlit_app.py
|-tests/test_socket_utils.py
use command
pip install streamlitFirst run the server:
python server_test.pyThen client:
streamlit run streamlit_app.pyThe client sends an 8-byte request (6 data bytes plus CRC) and reads the
37-byte server response (35 data bytes plus CRC). Each of the six request
fields is an unsigned byte (0–255); encode_request_data() validates the
field count, integer type, and byte range before the CRC is appended. The
shared socket helper handles fragmented TCP reads so incomplete packets are
not parsed as complete responses.
The socket framing helper has standard-library unit tests. Run them from the repository root:
python -m unittest discover -s tests -v

