Registry / http-networking / sockets

sockets

JSON →
library1.0.0pypypi✓ verified 80d ago

A lightweight Python package for creating simple servers and clients with sockets. Version 1.0.0 is the initial release. No active maintenance or release cadence observed.

pip install sockets
INSTALL
IMPORT
SIG · SOCKETS
S
sockets
http-networkingpythonv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

server
import sockets
from sockets import server

Create a simple echo server and client using sockets library.

from sockets import server, client def handle_client(conn): data = conn.recv(1024) print("Received:", data.decode()) conn.sendall(b"Hello from server") conn.close() # Run server in background (example) import threading t = threading.Thread(target=server.serve, args=('localhost', 9999, handle_client)) t.start() # Client example client.send('localhost', 9999, "Hello server")
Debug
Known issues
gotchaThe library is extremely minimal; it provides only `server` and `client` modules with basic functions. Do not expect advanced features like async, SSL, or automatic reconnection.
fix
For production use, consider asyncio's streams or the standard library `socket` module directly.
affects: >=1.0.0
gotchaThe `server.serve` function blocks forever; you must run it in a separate thread or process if you need to do other work.
fix
Use threading: `threading.Thread(target=server.serve, args=(host, port, handler)).start()`
affects: >=1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released Jun 21, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
sockets — pip install sockets · libregistry