https://github.com/jakubriegel/netcalc
A connective binary protocol for sending calculations with sample server-client app. This is a project for our studies
https://github.com/jakubriegel/netcalc
binary-protocol protocol python socket tcp
Last synced: about 2 months ago
JSON representation
A connective binary protocol for sending calculations with sample server-client app. This is a project for our studies
- Host: GitHub
- URL: https://github.com/jakubriegel/netcalc
- Owner: jakubriegel
- Created: 2018-11-06T20:32:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-14T09:26:35.000Z (over 5 years ago)
- Last Synced: 2025-02-01T23:41:52.999Z (4 months ago)
- Topics: binary-protocol, protocol, python, socket, tcp
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# netcalc
A connective binary protocol for sending calculations with sample server-client app. This is a project for our studies.## datagram structure
Each datagram size is 248 bits (31 bytes)data | bits | type
-----|------|-----
operation | 2 | uint
number a | 64 | IEEE-754
number b | 64 | IEEE-754
status | 2 | uint
session id | 16 | uint
mode | 3 | uint
result | 64 | IEEE-754
result id | 32 | uint
last flag | 1 | boolean## build
> It is recommended to build and run this script in virtual environment. Instructions for configuring it can be found in official Python [documentation](https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv).To get all dependencies type: `pip install -r requirements.txt`.
After making changes in dependencies remember to do: `pip freeze > requirements.txt`
## run
To run as server type: `python netcalc_server.py server_ip server_port`
To run as client type: `python netcalc_client.py server_ip server_port`If flags `server_ip` ale `server_port` are not supplied, the values used are respectively `127.0.0.1`(localhost) and `1500`