{"id":15536678,"url":"https://github.com/turbo87/cpp-lib","last_synced_at":"2026-06-12T21:32:43.532Z","repository":{"id":66146081,"uuid":"45132603","full_name":"Turbo87/cpp-lib","owner":"Turbo87","description":"General purpose and aviation-related C++ library","archived":false,"fork":false,"pushed_at":"2015-10-29T13:46:08.000Z","size":3755,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-21T21:56:35.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Turbo87.png","metadata":{"files":{"readme":"README-networking.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-28T18:13:28.000Z","updated_at":"2020-03-17T10:33:33.000Z","dependencies_parsed_at":"2023-02-19T23:30:40.810Z","dependency_job_id":null,"html_url":"https://github.com/Turbo87/cpp-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Turbo87/cpp-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Fcpp-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Fcpp-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Fcpp-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Fcpp-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Turbo87","download_url":"https://codeload.github.com/Turbo87/cpp-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Fcpp-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34263871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":[],"created_at":"2024-10-02T11:52:50.825Z","updated_at":"2026-06-12T21:32:43.506Z","avatar_url":"https://github.com/Turbo87.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Networking support in cpp-lib\n\nThe NETWORK component (`sys/network.h`) provides very easy to use\nclasses for TCP connections and UDP packets.  It is roughly based on\nthe [Networking Proposal for TR2] [1].  This proposal can be used \nas reference for NETWORK, however there there are some differences:\n\n- cpp-lib uses the namespace `cpl::util::network`, not `std::tr2`.\n- cpp-lib doesn't implement the `network_error` exceptions, but throws\n  `std::runtime_error` instead.\n- I/O multiplexing (`iowait()`) is not implemented.\n- The UDP (`datagram_sender`/`datagram_receiver`) doc is currently\n  out of date, future code will use `datagram_socket`.\n\nThe implementation transparently supports IPv4 and IPv6.\n\nIPv6 addresses with port numbers use square brackets as described \n[here] [2]:\n  `[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443`\n\n\n## Examples\n\nPlease see `testing/tcp-text.cpp` and `testing/udp-test.cpp` for very\nstraightforward server and client code.  Execute `make` and `make tests`\nfirst.\n\n\n### TCP\n\n* To get the current time from NIST daytime servers:\n  \n  `bin/opt/tcp-test daytime`\n\n* To download a web site:\n\n  `bin/opt/tcp-test wget http://www.boost.org/ \u003e foo.html`\n  \n  `less foo.html`\n\n* To start a multi-threaded string reversal server listening on port 4711:\n\n  `bin/opt/tcp-test reverse 4711`\n\n  Connect to the server:\n\n  `telnet localhost 4711`, or:\n  `bin/opt/tcp-test telnet localhost 4711`\n\n* A simple telnet client:\n\n  `bin/opt/tcp-test telnet localhost 4711`\n  `bin/opt/tcp-test telnet your.telnet.server 80`\n\n* Run a hello world server and receive a greeting using netcat (nc):\n\n  `bin/opt/tcp-test hello 12345`\n  `nc localhost 12345`\n\n### UDP\n\nTo receive data on port 4711 using IPv6:\n\n  `bin/opt/udp-test receive ip6 4711`\n\nTo send data to port 4711:\n\n  `bin/opt/udp-test send ip6 ::1 4711`\n\nA simple pong server that listens for incoming packets and sends a reply:\n  `bin/opt/udp-test pong ip6 4711`\n\nIn another window, you can send a message and receive the reply:\n  `bin/opt/udp-test ping ip6 ::1 4711 \"Hello world\"`\n\nUse ip4 and 127.0.0.1 instead of ::1 and 4711 if your system doesn't \nsupport IPv6.\n\n\n\n### DNS\n\n* To resolve a datagram address:\n\n  `bin/opt/udp-test resolve google.com 4711`\n\n  Notice that multiple node/service pairs may be returned.\n\n## Bugs\n\nPlease see TODO.md for known bugs and TODO items.\n\n[1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1925.pdf\n[2]: http://en.wikipedia.org/wiki/IPv6_address\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbo87%2Fcpp-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturbo87%2Fcpp-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbo87%2Fcpp-lib/lists"}