ezpysocket

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.


Keywords
cpp, demo, opencv, python, socket-communication
License
MIT
Install
pip install ezpysocket==0.0.3

Documentation

Ez-Cpp-Python-Socket

Creating tools to enable cpp python socket communication.

This is source of developed 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<int>   Y       Y   vector<int>     <->     list
list<float> Y       Y   vector<float>   <->     list
image       Y       Y

The following configurations are supported:

  Server  Client
1. Cpp     Cpp  
2. Cpp     Py   
3. Py      Cpp  
4. Py      Py   

Installation

Preferably use dockers or virtual environments.

Linux:

Python Dependencies

./install_dep.sh

C++ Dependencies : Install OpenCV

Demo

Docker

./build_docker.sh # builds docker image as required.
./run_docker.sh # takes you directly to demo

Local Installation / VirtualEnv

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

Usage Example

To inspect usage of commands, Refer to run_server and run_client scripts in python & cpp folders.

Meta

Aditya Divakaran - @LinkedIn - @Github - @GMail

Note:

  • This was tested on Ubuntu 20.04 in a virtual environment and on docker.
  • This is a fun project that was picked up while understanding socket communication for other projects that I'm tinkering with.