{"id":18610248,"url":"https://github.com/bluecannonball/polynet","last_synced_at":"2025-09-06T20:33:54.004Z","repository":{"id":37623572,"uuid":"449923198","full_name":"BlueCannonBall/Polynet","owner":"BlueCannonBall","description":"A simple, cross-platform networking abstraction for C++.","archived":false,"fork":false,"pushed_at":"2025-06-01T01:50:58.000Z","size":267,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T03:34:56.976Z","etag":null,"topics":["cpp","cross-platform","internet","network","networking","tcp","udp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueCannonBall.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,"zenodo":null}},"created_at":"2022-01-20T02:10:52.000Z","updated_at":"2025-06-01T01:51:02.000Z","dependencies_parsed_at":"2023-01-19T13:00:16.524Z","dependency_job_id":"59ecc4c0-2542-4cdb-9d58-da983986d0d5","html_url":"https://github.com/BlueCannonBall/Polynet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BlueCannonBall/Polynet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueCannonBall%2FPolynet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueCannonBall%2FPolynet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueCannonBall%2FPolynet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueCannonBall%2FPolynet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueCannonBall","download_url":"https://codeload.github.com/BlueCannonBall/Polynet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueCannonBall%2FPolynet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273959012,"owners_count":25198139,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","cross-platform","internet","network","networking","tcp","udp"],"created_at":"2024-11-07T03:09:03.330Z","updated_at":"2025-09-06T20:33:53.981Z","avatar_url":"https://github.com/BlueCannonBall.png","language":"C++","readme":"# Polynet\nPolynet is a simple, cross-platform networking abstraction for C++.\n\n## Usage\nPolynet is designed to be similar to Berkeley sockets while using C++ features such as objects, methods, inheritance, and templates. Polynet supports TCP and UDP.\n\n### Quick Examples\n```cpp\npn::init();\n\n// Creating a TCP server\npn::tcp::Server server;\nif (server.bind(\"0.0.0.0\", 8000) == PN_ERROR) {\n    std::cerr \u003c\u003c \"Error: \" \u003c\u003c pn::universal_strerror() \u003c\u003c std::endl;\n    exit(EXIT_FAILURE);\n}\n\n// Accepting connections (this blocks until an error occurs or the callback returns false)\nif (server.listen(/* Accept callback */) == PN_ERROR) {\n    std::cerr \u003c\u003c \"Error: \" \u003c\u003c pn::universal_strerror() \u003c\u003c std::endl;\n    exit(EXIT_FAILURE);\n}\n\n// Creating a TCP client\npn::tcp::Client client;\nif (client.connect(\"localhost\", 8000) == PN_ERROR) {\n    std::cerr \u003c\u003c \"Error: \" \u003c\u003c pn::universal_strerror() \u003c\u003c std::endl;\n    exit(EXIT_FAILURE);\n}\n\npn::quit();\n```\nSee `polynet.hpp` and `smart_sockets.hpp` to check out more ways to use Polynet. Since the secure examples are a bit longer, they can be found in the examples directory.\n\n### What are `pn::UniqueSocket`, `pn::SharedSocket`, and `pn::WeakSocket`?\nThese 3 class templates are like `std::unique_ptr`, `std::shared_ptr`, and `std::weak_ptr`, except they work with sockets rather than pointers. They ensure that sockets they own are automatically closed once they are no longer needed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluecannonball%2Fpolynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluecannonball%2Fpolynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluecannonball%2Fpolynet/lists"}