{"id":27406,"library":"sockets","title":"sockets","description":"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.","status":"active","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/eshiofune/sockets","tags":["sockets","networking","client-server"],"install":[{"cmd":"pip install sockets","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Direct import as per the package's __init__.py.","wrong":"","symbol":"server","correct":"from sockets import server"},{"note":"","wrong":"","symbol":"client","correct":"from sockets import client"}],"quickstart":{"code":"from sockets import server, client\n\ndef handle_client(conn):\n    data = conn.recv(1024)\n    print(\"Received:\", data.decode())\n    conn.sendall(b\"Hello from server\")\n    conn.close()\n\n# Run server in background (example)\nimport threading\nt = threading.Thread(target=server.serve, args=('localhost', 9999, handle_client))\nt.start()\n\n# Client example\nclient.send('localhost', 9999, \"Hello server\")","lang":"python","description":"Create a simple echo server and client using sockets library."},"warnings":[{"fix":"For production use, consider asyncio's streams or the standard library `socket` module directly.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use threading: `threading.Thread(target=server.serve, args=(host, port, handler)).start()`","message":"The `server.serve` function blocks forever; you must run it in a separate thread or process if you need to do other work.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Reinstall: `pip install --upgrade sockets` and verify version >= 1.0.0.","cause":"Older versions or incorrect installation; package may not expose 'server' directly.","error":"ImportError: cannot import name 'server' from 'sockets'"},{"fix":"Call `server.serve(host, port, handler_func)` with a callable that accepts one argument (connection socket).","cause":"The `handler` parameter is required but omitted.","error":"TypeError: server.serve() missing 1 required positional argument: 'handler'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}