Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A simple TCP client/server framework

Project description


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)

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

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

except KeyboardInterrupt:

Shutdown the server

And Easy to Install


$ pip3 install dhtcplib

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dhtcplib, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size dhtcplib-0.2.1.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page