Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.
View Demo
·
Report Bug
·
Request Feature
Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.
Types of messages that can be sent to and fro are as shown below:
Type | Cpp | Python | Extra Info |
---|---|---|---|
bool | Y | Y | |
string | Y | Y | |
int | Y | Y | |
float | Y | Y | |
list | Y | Y | vector <-> list |
list | Y | Y | vector <-> list |
image | Y | Y | cv::Mat |
The following configurations are supported:
Server | Client |
---|---|
Cpp | Cpp |
Cpp | Py |
Py | Cpp |
Py | Py |
Addition Server-Client Configurations include:
- Polling in case address is busy: Cpp Python
- Start and end tokens for every message passed Cpp Python
- Continuous streaming (with webcam) Cpp Python
- Python
- Cpp
- Docker
- OpenCV
Preferably use dockers or virtual environments. For a quickstart demo, do not follow local installation steps.
-
Clone the repo
git clone https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket.git
-
Enter the directory of the repo
-
Follow launch specific instruction
-
Linux Local Installation
./install_dep.sh # Install all python dependencies
C++ Dependencies : Install OpenCV
-
Docker (Linux)
./build_docker.sh # Build docker image in demo or dev mode
-
./launch_docker.sh # runs demo directly if demo mode was selected while building
# If in dev mode, after launching docker with previous command
./run_examples.sh # run demo
./tests/test_<name_of_test>.sh # to test library configurations as a demo
# Finally to remove the docker image after playing around
./remove_docker.sh # removes docker image from system
Assuming that OpenCV has already been installed and accessible by C++. Run shell script to download python dependencies and run demo. To run demo of server and client together,
./run_examples.sh
To test out demo of example configurations
./tests/test_<name_of_test>.sh
To inspect usage of commands,
Refer to run_server and run_client scripts in python & cpp folders.
For additional examples check out the examples folders in each folder.
Any contributions made are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Aditya Divakaran - @LinkedIn - @Github - @GMail
Note:
- This was tested on Ubuntu 20.04 in a virtual environment and on Docker.
- Image used in repo is from Pixabay.
- This is a fun project that was picked up while understanding socket communication for other projects that I'm tinkering with.