Skip to main content

Protocol to provide fast and light communication between devices over (W)LAN

Project description

UltraSockets

Quasi-Application layer protocol to provide fast and light communication between devices on (W)LAN. It's built to facilitate "casual" data transfer between devices such as laptops and microcontrollers. It is easier and faster to develop compared to TCP, while not having as high of an overhead and baggage as HTTP.

Features:

1. Full-duplex communication with fully-automated threading to enable it

2. Supports efficient multiple client-client communication

3. Has a user-friendly handshake layer which can be modified to provide encryption and compression

Documentation

This is a very brief documentation of UltraSockets. The package was meant to be easy to use and understand from the very beginning, so this hopefully shouldn't be too confusing. Most of the technical details of TCP should be taken care of, so that even for beginners the package can be usable

The Client

This is the individual unit of the UltraSockets system. It is a computer which is connected to the communications network.

client = Client(hostname,name)

Hostname will be the IP of the host/server and the port. "192.168.x.xxx:8000" for example, where 8000 is the port.

Name is the name given to the client. This is just a string like "PC2" which is used to refer to the client when messages are sent.

client.get(num)

Num can be the number of messages that you want to retrieve from the Queue which contains all the messages recieved so far. If no messages are present, it returns None. It operates as First In, Last Out. It will return a list like so:

[ [ name_of_recipient , message , message_serial_number ] , [...] , ... ]

Num can also be "all" which will return a list of all the messages that have been recieved

client.send(name, message)

The name is the name of the recipient who the messsage is going to be sent to,

Message is the message itself which is going to be transmitted. It can be any data type

client.close()

It will temporarily close the thread which is used for recieving messages. This means the client can no longer recieve messages. One use case is when an intensive task is being performed, so the client wants to only have the main thread running to maximize efficiency

client.open()

It will reopen the message collecting thread that has been closed. Now the client can recieve messages again.

client.terminate()

This will permanently close the message recieving thread. It lets the client cleanly exit out of the network after they are done.

The Server

The Server object is the host computer. However, it is not really a "host" anymore due to the message routing that takes place under UltraSockets. While it is a server at a technical level, the user will not be able to tell the difference between it, and any other client.

server = Server(hostname,connections,name)

This will create the server object.

Hostname will be the IP of the host and the port. In this case the server is the host, so your own IP address will be entered as a string."192.168.x.xxx:8000" for example, where 8000 is the port.

Port is the port on which communications will take place. It will be a number like 8000.

Connections is the number of connections supported by the server. It is the number of clients that can connect to the server. This must be exactly equal to the number of clients that will join - no more or no less.

Name is the name given to the server computer. This is just a string like "PC1" which is used to refer to the server

server.send(name, message)

The name is the name of the recipient who the messsage is going to be sent to,

Message is the message itself which is going to be transmitted. It can be any data type

server.get(num)

Num can be the number of messages that you want to retrieve from the Queue which contains all the messages recieved so far. If no messages are present, it returns None. It operates as First In, Last Out. It will return a list like so:

[ [ name_of_recipient , message , message_serial_number ] , [...] , ... ]

Num can also be "all" which will return a list of all the messages that have been recieved

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

ultra_sockets-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ultra_sockets-1.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file ultra_sockets-1.0.0.tar.gz.

File metadata

  • Download URL: ultra_sockets-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for ultra_sockets-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4563d264ab152d97eef1076c669609b99f18984c2c7beea63761e19dea69386f
MD5 f87cb894d4ce92cd6b6a453d018757fa
BLAKE2b-256 e6d738c3aa757f1753177bee0e929bf0bf9a8f385bcd056d918a82903c6b617b

See more details on using hashes here.

File details

Details for the file ultra_sockets-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ultra_sockets-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for ultra_sockets-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40af11356663b80b21f45af0f2591379063b349a7a02d7fcf76d87facb569da2
MD5 1baf2fe58b54e387f509888ec73f258d
BLAKE2b-256 3a7132f0c712dcbcfa6fe3c3c72723d8acb172d3055bdcbb48f2145cbb0e6588

See more details on using hashes here.

Supported by

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