Skip to main content

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

Project description

Ez-Cpp-Python-Socket


Logo

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.
View Demo · Report Bug · Request Feature

Table of Contents

About The Project

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

About The Project Gif

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

Built With

  • Python
  • Cpp
  • Docker
  • OpenCV

Getting Started

Preferably use dockers or virtual environments. For a quickstart demo, do not follow local installation steps.

Installation

  1. Clone the repo

    git clone https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket.git
    
  2. Enter the directory of the repo

  3. 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
      

Demo

Run Examples

run_example_gif

Processed Webcam Stream

run_webcam_gif

Docker

./run_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

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

To test out demo of example configurations

./tests/test_<name_of_test>.sh

Usage

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.

Contributing

Any contributions made are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezpysocket-0.0.3.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

ezpysocket-0.0.3-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page