Skip to main content

Better Python sockets and asyncio streams

Project description

BetterSockets

The alternative for Python sockets and asyncio streams is here

Usage:

To use this library just import BetterSockets, and you are good to go. Start by choosing your class in form of a client or a server, by writing client = BetterSockets.Client() or server = BetterSockets.HubServer() / ProcessorServer(). You can customize the client in some ways, as well as the server. For that we make the use of keyword arguments. You can choose whether you want to utilise the normal python sockets or an asynchronous stream by putting in a is_async= - followed by a boolean inside the apprentices of the class. In the same way you can modify the port, ip and a debug - menu. For the ProcessorServer you can add a function to process incoming messages by placing a func=function inside the corresponding apprentices. Same goes for the client, but it is different for the HubServer, you can put a identifier=Function inside it. It is used to determine whether the client gains access to the server. To start listening on a server-class, you need to call the listen() function of that class. For the client to send data, you need to call the send() function, just put the data you want to send inside the apprentices.

Changelog

0.0.1a.3 (14.07.2021)

  • Fixed a bug within the setup.py

0.0.1a.2 (14.07.2021)

  • Bug fixes for init.py and package structure

0.0.1a1 (14.07.2021)

  • Bug fix for BetterSockets.Client() not working

0.0.1a0 (14.07.2021)

  • Release of this package

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

BetterSockets-0.0.1a3.tar.gz (1.6 MB view details)

Uploaded Source

File details

Details for the file BetterSockets-0.0.1a3.tar.gz.

File metadata

  • Download URL: BetterSockets-0.0.1a3.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for BetterSockets-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 446bb01e7fe334f34e78ba8424b7df23c8c9e182e4a596f392dc038d9660632a
MD5 f4ea563827ddf3c5d23d42665dd6749b
BLAKE2b-256 d57233b9aed55c2511d068da22c728068aaf4970ac77b7b5a0917b1563379815

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