{"id":15988542,"url":"https://github.com/woile/beej-rs","last_synced_at":"2025-08-24T01:07:07.424Z","repository":{"id":240492035,"uuid":"802780257","full_name":"woile/beej-rs","owner":"woile","description":"\"Beej's Guide to Network Programming\" in Rust","archived":false,"fork":false,"pushed_at":"2024-05-20T06:48:40.000Z","size":25,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T01:47:11.972Z","etag":null,"topics":["network-programming","sockets"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/woile.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":"2024-05-19T08:46:44.000Z","updated_at":"2025-03-21T19:54:35.000Z","dependencies_parsed_at":"2024-05-19T09:38:44.260Z","dependency_job_id":"1ef37aac-176e-4e9a-8efa-228a550ab59b","html_url":"https://github.com/woile/beej-rs","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"42c20821b0e2f822fd50a1a280a5e8527585b146"},"previous_names":["woile/beej-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Fbeej-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Fbeej-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Fbeej-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woile%2Fbeej-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woile","download_url":"https://codeload.github.com/woile/beej-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354289,"owners_count":21416749,"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":["network-programming","sockets"],"created_at":"2024-10-08T04:05:22.132Z","updated_at":"2025-04-23T01:47:19.319Z","avatar_url":"https://github.com/woile.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beej-rs\n\n\u003e An implementations in rust of the different code samples in [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/)\n\n\u003e [!WARNING]\n\u003e The first few exercises were implemented using [libc](https://docs.rs/libc/latest/libc/index.html) which has a lot of unsafe code.\n\u003e The latter exercises were impemented using [nix](https://docs.rs/nix/0.28.0/nix/index.html) which is a safer alternative.\n\n## Usage\n\n```console\n\u003e cargo run -- --help\nUsage: beej-rs \u003cCOMMAND\u003e\n\nCommands:\n  show-ip          Section 5.1 \"getaddrinfo() -- Prepare to Launch\": Show IP addresses\n  stream-server    Section 6.1 \"A Simple Stream Server\": TCP server\n  stream-client    Section 6.2 \"A Simple Stream Client\": TCP client\n  socket-listener  Section 6.3 \"Datagram Sockets\": UDP server. From now on, we use `nix` for c bindings, which is a little bit safer than `libc`\n  socket-talker    Section 6.3 \"Datagram Sockets\": UDP client\n  poll-std-in      Section 7.2 \"poll() - Synchonous I/O Multiplexing\": Poll stdin for input\n  poll-server      Section 7.2 \"poll() - Synchonous I/O Multiplexing\": Poll server for input\n  select           Section 7.3 \"select()—Synchronous I/O Multiplexing, Old School\": Wait for something to appear on standard input\n  select-server    Section 7.3 \"select()—Synchronous I/O Multiplexing, Old School\": Simple multi-user chat server\n  broadcaster      Section 7.7 \"Broadcast Packets—Hello, World!\": A UDP Client that broadcasts\n  help             Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n## Examples\n\n- Section 5.1 \"getaddrinfo() -- Prepare to Launch\"\n  - Bindings: `libc`\n  - [showip.c](https://beej.us/guide/bgnet/examples/showip.c) -\u003e [showip.rs](./src/examples/showip.rs)\n- Section 6.1 \"A Simple Stream Server\"\n  - Bindings: `libc`\n  - Protocol: `TCP`\n  - [server.c](https://beej.us/guide/bgnet/examples/server.c) -\u003e [server.rs](./src/examples/server.rs)\n- Section 6.2 \"A Simple Stream Client\"\n  - Bindings: `libc`\n  - Protocol: `TCP`\n  - [client.c](https://beej.us/guide/bgnet/examples/client.c) -\u003e [client.rs](./src/examples/client.rs)\n- Section 6.3 \"Datagram Sockets\" UDP Server\n  - Bindings: `nix`\n  - Protocol: `UDP`\n  - [listener.c](https://beej.us/guide/bgnet/examples/listener.c) -\u003e [listener.rs](./src/examples/listener.rs)\n- Section 6.3 \"Datagram Sockets\" UDP Client\n  - Bindings: `nix`\n  - Protocol: `UDP`\n  - [talker.c](https://beej.us/guide/bgnet/examples/talker.c) -\u003e [talker.rs](./src/examples/talker.rs)\n- Section 7.2 \"poll() - Synchonous I/O Multiplexing\"\n  - Bindings: `nix`\n  - Poll stdin for input\n  - [poll.c](https://beej.us/guide/bgnet/examples/poll.c) -\u003e [poll.rs](./src/examples/poll.rs)\n- Section 7.2 \"poll() - Synchonous I/O Multiplexing\"\n  - Poll server for input\n  - Bindings: `nix`\n  - Protocol: `TCP`\n  - [pollserver.c](https://beej.us/guide/bgnet/examples/pollserver.c) -\u003e [pollserver.rs](./src/examples/pollserver.rs)\n- Section 7.3 \"select()—Synchronous I/O Multiplexing, Old School\"\n  - Bindings: `nix`\n  - select from stdin\n  - [select.c](\u003c(https://beej.us/guide/bgnet/examples/select.c)\u003e) -\u003e [select.rs](./src/examples/select.rs)\n- Section 7.3 \"select()—Synchronous I/O Multiplexing, Old School\"\n  - select server\n  - Bindings: `nix`\n  - Protocol: `TCP`\n  - [selectserver.c](https://beej.us/guide/bgnet/examples/select.c) -\u003e [selectserver.rs](./src/examples/selectserver.rs)\n- Section 7.7 \"Broadcast Packets—Hello, World!\"\n  - Bindings: `nix`\n  - Protocol: `UDP`\n  - broadcast client\n  - [broadcaster.c](https://beej.us/guide/bgnet/examples/broadcaster.c) -\u003e [broadcaster.rs](./src/examples/broadcaster.rs)\n\nNote: the design of the cli grew organically as I was reading the book, so it's quite incoherent\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoile%2Fbeej-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoile%2Fbeej-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoile%2Fbeej-rs/lists"}