{"id":18561809,"url":"https://github.com/pseudomanifold/simpleserver","last_synced_at":"2025-04-10T03:31:05.365Z","repository":{"id":92126033,"uuid":"39311840","full_name":"Pseudomanifold/SimpleServer","owner":"Pseudomanifold","description":"Simple TCP/IP server implementation in modern C++","archived":false,"fork":false,"pushed_at":"2019-07-23T09:43:43.000Z","size":170,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T15:47:23.167Z","etag":null,"topics":["c-plus-plus","cpp11","network","qotd-server","simple-server","tcp-server"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pseudomanifold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-18T20:31:59.000Z","updated_at":"2024-12-18T20:50:38.000Z","dependencies_parsed_at":"2023-03-13T17:33:25.239Z","dependency_job_id":null,"html_url":"https://github.com/Pseudomanifold/SimpleServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pseudomanifold%2FSimpleServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pseudomanifold%2FSimpleServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pseudomanifold%2FSimpleServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pseudomanifold%2FSimpleServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pseudomanifold","download_url":"https://codeload.github.com/Pseudomanifold/SimpleServer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248150820,"owners_count":21055988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cpp11","network","qotd-server","simple-server","tcp-server"],"created_at":"2024-11-06T22:07:57.577Z","updated_at":"2025-04-10T03:31:05.347Z","avatar_url":"https://github.com/Pseudomanifold.png","language":"C++","readme":"# SimpleServer\n\nThis repository contains [my](http://bastian.rieck.ru) implementation of\na simple TCP/IP server in C++. I started fiddling with this to learn\nmore about UNIX network programming.\n\nSee [the initial blog post](http://bastian.rieck.ru/blog/posts/2015/sockets_ordeal_cxx11)\nor [its successor](http://bastian.rieck.ru/blog/posts/2015/synchronous_multiplexing_sockets_cxx11) for\nadditional information and comments.\n\n## How do I use the API?\n\nThe sources are meant to become an API when they grow up. At present\nthere are two server implementations:\n\n* `qotd.cc` contains a *Quote of the Day* service implementation\n* `echo.cc` contains an *echo* service implementation\n\n## What's cool about it?\n\nGood question. I wanted to encapsulate the C API for socket programming\nand make it more modern. So far, I did not really succeed, I guess.\nThere is one cool thing at the moment: Requests are handled by\nspecifying an arbitrary function object (yay, C++11). This function is\nthen called asynchronously (yay, C++11 again!) whenever a new client is\naccepted. You can then send stuff to the client or whatever...\n\n## How do I run my own QOTD server?\n\nThat at least I may answer! After cloning this repository, please run\nthe following commands:\n\n    $ mkdir build\n    $ cd build\n    $ cmake ../\n    $ make\n    $ ./qotd ../Quotes.txt\n\nYou can exit the server with CTRL+C. You can connect to your server like\nthis:\n\n    $ nc localhost 1041\n\n## Why is the QOTD server not running under port 17?\n\nBecause most Linux distributions disallow opening ports below 1024\nwithout root access or at least configuration changes. While I think\nthat I am a trustworthy person, I do not presume that you want to\ncompile this as root...\n\nThus, the QOTD server runs under port 1041, which is 1024+17 and hence\nquite clever.\n\n## How do I run my own echo server?\n\n    $ mkdir build\n    $ cd build\n    $ cmake ../\n    $ make\n    $ ./echo\n\nNote that the server runs under port 1031, which is 1024+7 and hence\nquite clever as well (see the answer to the previous question).\n\n## Acknowledgements\n\nThanks to [Uri London](https://github.com/uri247) for very useful\nsuggestions that helped improve the code.\n\n## Licence\n\nThe code is released under an MIT licence.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudomanifold%2Fsimpleserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpseudomanifold%2Fsimpleserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseudomanifold%2Fsimpleserver/lists"}