A Python module for sending data across TCP sockets
Project description
PyDataSocket
This module provides an extremely easy to use python implementation of TCP Sockets for sending data. The supported data formats are anything that is json-serializable when using the DataSocket.JSON
mode or anything that can be converted to a numpy array when using the DataSocket.NUMPY
mode. This implementation utilizes threading so they are non-blocking. See the examples for how to use.
Install
git clone https://github.com/psomers3/PyDataSocket.git
cd PyDataSocket
pip install .
SendSocket()
The send socket is where the data form to use (JSON or NUMPY) is set and then informs the connecting RecieveSocket upon a successful connection. Data can be sent using SendSocket.send_data()
.
ReceiveSocket()
The data recieved by the receive socket is accessed by assigning a function to handler_function
upon creation that will be called everytime a new chunk of data is recieved. This is run on a separate thread, so it will not block more incoming data, but it is recommended to keep the assigned function as short as possible.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file PyDataSocket-0.0.1-py2.7.egg
.
File metadata
- Download URL: PyDataSocket-0.0.1-py2.7.egg
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5bdf06720d7f44ca294c94bcf6bf7f9e18e83e4e8b82d47600910a104a10d8d |
|
MD5 | c0981b94345b35c68416a9c7b5f4dd5f |
|
BLAKE2b-256 | bb8fb8f706225175399f99ea99d032a8b1186c234579db5a7e334546ef664c02 |