{ "info": { "author": "Evans Ehiorobo", "author_email": "ehioroboevans@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# ABOUT\n Python package which allows creation of simple servers and clients for communication with sockets. Supports both Python2 and Python3.\n Version: 1.0.0\n\n# USAGE\n - To create a server: Depending on your Python version, import the Server class from the appropriate server module, subclass it and override its act_on() method which describes what it should do when it receives a request, and returns a string response. Finally, create a Server object and call its listen() method.\n\n - To create a client: Depending on your Python version, import the Client class from the appropriate client module, create a Client object and call its poll_server() method. You can then make use of the response it returns as required.\n\n By default, a Python2 client will poll the default Python3 server while a Python3 client will poll the default Python2 server (unlike in the examples below).\n\n# EXAMPLES\n # Test server with Python2:\n from sockets.python2.server import Server\n class MyServer(Server):\n def act_on(self, data, addr):\n # Do something with data (in bytes) and return a string.\n return data\n server = MyServer(listening_address=('127.0.0.1', 11112))\n server.listen()\n\n # Test client with Python2. Polls the Python2 server.\n from sockets.python2.client import Client\n client = Client()\n response, addr = client.poll_server(\"Hello world\", server=('127.0.0.1', 11112))\n print response, addr\n\n # Test server with Python3:\n from sockets.python3.server import Server\n class MyServer(Server):\n def act_on(self, data, addr):\n # Do something with data (in bytes) and return a string.\n return data.decode()\n server = MyServer(listening_address=('127.0.0.1', 11113))\n server.listen()\n\n # Test client with Python3. Polls the Python3 server.\n from sockets.python3.client import Client\n client = Client()\n response, addr = client.poll_server(\"Hello world\", server=('127.0.0.1', 11113))\n print(response, addr)\n\n# CONTRIBUTING AUTHORS\n Ehiorobo Evans (2018).\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eshiofune/sockets", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sockets", "package_url": "https://pypi.org/project/sockets/", "platform": "", "project_url": "https://pypi.org/project/sockets/", "project_urls": { "Homepage": "https://github.com/eshiofune/sockets" }, "release_url": "https://pypi.org/project/sockets/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Python package which allows creation of simple servers and clients for communication with sockets", "version": "1.0.0" }, "last_serial": 3985332, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "99c8236c29513713d7cc4e576b4e3c97", "sha256": "cdb78b0f37b78adadedcc55cdd73c61aacbeb0f00c4c551f1b60f1463457c90b" }, "downloads": -1, "filename": "sockets-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "99c8236c29513713d7cc4e576b4e3c97", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4495, "upload_time": "2018-06-21T11:26:47", "url": "https://files.pythonhosted.org/packages/cd/84/bd124c5d3c012de593c45c7f0208615c73493859bbd5389e1403e311d387/sockets-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "815fe9cd067f99368fa49e2500b505cb", "sha256": "0d5691402d3da39c9ef6330647d847b0bed93a4ce8b23bf1a18133e2dcbb5c8d" }, "downloads": -1, "filename": "sockets-1.0.0.tar.gz", "has_sig": false, "md5_digest": "815fe9cd067f99368fa49e2500b505cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2502, "upload_time": "2018-06-21T11:26:48", "url": "https://files.pythonhosted.org/packages/c2/a7/6bc7eeefb624e03e5a34c2c0d8eff6525487b1af0ccfd62d0f83a62a5400/sockets-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "99c8236c29513713d7cc4e576b4e3c97", "sha256": "cdb78b0f37b78adadedcc55cdd73c61aacbeb0f00c4c551f1b60f1463457c90b" }, "downloads": -1, "filename": "sockets-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "99c8236c29513713d7cc4e576b4e3c97", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4495, "upload_time": "2018-06-21T11:26:47", "url": "https://files.pythonhosted.org/packages/cd/84/bd124c5d3c012de593c45c7f0208615c73493859bbd5389e1403e311d387/sockets-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "815fe9cd067f99368fa49e2500b505cb", "sha256": "0d5691402d3da39c9ef6330647d847b0bed93a4ce8b23bf1a18133e2dcbb5c8d" }, "downloads": -1, "filename": "sockets-1.0.0.tar.gz", "has_sig": false, "md5_digest": "815fe9cd067f99368fa49e2500b505cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2502, "upload_time": "2018-06-21T11:26:48", "url": "https://files.pythonhosted.org/packages/c2/a7/6bc7eeefb624e03e5a34c2c0d8eff6525487b1af0ccfd62d0f83a62a5400/sockets-1.0.0.tar.gz" } ] }