Skip to main content

A simple TCP client/server framework

Project description


Dhtcplib
--------

dhtcplib makes threaded TCP servers and connections to servers really easy.

```````````````

::

from time import sleep
from dhtcplib import dhtcp

'''
Start the server
'''
class MyHandlerClass:
def handle(data):
print("Handler got data: ", data)
return(data)

# Using a defined class with a 'handle' method to route requests
my_serv = dhtcp("127.0.0.1", 9000, RouterClass=MyHandlerClass)
my_serv.start()

try:
while True:
print("Do something in your main thread while the server slaves away!")
sleep(5)

except KeyboardInterrupt:

'''
Shutdown the server
'''
my_serv.kill()


And Easy to Install
```````````````````

::

$ pip3 install dhtcplib


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

dhtcplib-0.2.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file dhtcplib-0.2.1.tar.gz.

File metadata

  • Download URL: dhtcplib-0.2.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dhtcplib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b7360c1dc7a83bdc648a206b28172ebcf22c4f583fdd231c0e41e9efb2722a07
MD5 bf209ab707b027585fb85da01738f1d7
BLAKE2b-256 0ca730ef228ef1f1ade96a834f9b75330b4ea4860bb9067048907003e0481339

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