Skip to content

Easy to use TCP Sockets for sending data

Notifications You must be signed in to change notification settings

maniok098/PyDataSocket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Easy to use TCP Sockets for sending data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 86.5%
  • MATLAB 13.5%