{"id":30802041,"url":"https://github.com/numbleroot/cubbyhole-server","last_synced_at":"2025-09-05T21:12:31.067Z","repository":{"id":150312885,"uuid":"51157526","full_name":"numbleroot/cubbyhole-server","owner":"numbleroot","description":"An implementation of a cubbyhole protocol server in C.","archived":false,"fork":false,"pushed_at":"2016-02-08T18:08:45.000Z","size":216,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-31T20:54:30.316Z","etag":null,"topics":["c","cubbyhole","protocol"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numbleroot.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}},"created_at":"2016-02-05T16:12:11.000Z","updated_at":"2019-06-13T22:47:42.000Z","dependencies_parsed_at":"2023-04-29T08:12:48.569Z","dependency_job_id":null,"html_url":"https://github.com/numbleroot/cubbyhole-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/numbleroot/cubbyhole-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbleroot%2Fcubbyhole-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbleroot%2Fcubbyhole-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbleroot%2Fcubbyhole-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbleroot%2Fcubbyhole-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numbleroot","download_url":"https://codeload.github.com/numbleroot/cubbyhole-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbleroot%2Fcubbyhole-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273820982,"owners_count":25174126,"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-05T02:00:09.113Z","response_time":402,"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":["c","cubbyhole","protocol"],"created_at":"2025-09-05T21:12:22.381Z","updated_at":"2025-09-05T21:12:31.060Z","avatar_url":"https://github.com/numbleroot.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cubbyhole server\n\nA multi-threaded server implemented in C serving clients speaking the [cubbyhole protocol](#protocol).\n\n## Background\n\nFor one of my university courses ([Network Protocols and Architectures](http://www.inet.tu-berlin.de/menue/teaching0/ws201516/npa_1516/parameter/en/)) in the last assignment of the semester we were asked to implement a server capable of serving clients speaking a protocol designed by the department. The protocol provides the functionality of a [pigeon-hole messagebox](https://en.wikipedia.org/wiki/Pigeon-hole_messagebox), thus the name **cubbyhole protocol**. Multiple clients were expected to be able to connect to such a cubbyhole server and either store (PUT), retrieve (GET), see (LOOK) or delete (DROP) a message. Other than that it was required to make the server somewhat fault tolerant, so that e.g. incomplete requests or sudden disconnects would not impair the server.\n\nThis implementation is my take on a C version.\n\n## Dependencies\n\nIn order to compile the server, the ```pthread``` library is needed. Please make sure to have it available on your system.\n\n## Installation\n\nClone this repository into a location of your liking, switch into the created folder and ```make``` the project:\n\n```bash\n$ git clone https://github.com/numbleroot/cubbyhole-server.git\n$ cd cubbyhole-server\n$ make\n```\n\nAfter this, the executable ```cubbyhole-server``` should have been created. By supplying a port to listen on after the executable you can start the server:\n\n```bash\n$ ./cubbyhole-server 12345\nCubbyhole server listening on port 12345.\n```\n\nNow start up a networking utility capable of sending and receiving TCP connections (such as ```netcat``` and ```telnet``` are capable of) and connect to the cubbyhole server on the just specified port, e.g.:\n\n```bash\n$ nc localhost 12345\n```\n\nExperiment with the commands in [Protocol](#protocol).\n\n## Protocol\n\nThe goal of the cubbyhole protocol is to share (PUT) one message on the server so that potentially multiple clients can retrieve (GET), see (LOOK) or delete (DROP) it. The following commands are supported for clients:\n\n| Command   | Argument    | Description                                                                       |\n|:--------: |:----------: |---------------------------------------------------------------------------------- |\n| **PUT**   | `\u003cmessage\u003e` | Store a message on the server, eventually overwriting the old message.            |\n| **GET**   | -           | Retrieve and delete the message from server and display it to requesting client.  |\n| **LOOK**  | -           | Retrieve but do not delete message and display it to requesting client.           |\n| **DROP**  | -           | Delete currently stored message on server.                                        |\n| **HELP**  | -           | Display the list of possible commands.                                            |\n| **QUIT**  | -           | Gracefully terminate the connection.                                              |\n\nThis leads to a state diagram of the server cubbyhole that might look like this one:\n\n![State diagram of cubbyhole on server](https://github.com/numbleroot/cubbyhole-server/blob/master/state-diagram.png)\n\n## Other cubbyhole implementations\n\nOf course I am not the only student in that class, so here is a probably incomplete list of implementations of my fellow students:\n\n* [cubbyhole](https://github.com/MetalMatze/cubbyhole) by [MetalMatze](https://github.com/MetalMatze) - [Go](https://golang.org/)\n* [cubbyhole](https://github.com/KjellPirschel/cubbyhole) by [KjellPirschel](https://github.com/KjellPirschel) - C\n\n## License\n\nThis project is [GPLv3 licensed](https://raw.githubusercontent.com/numbleroot/cubbyhole-server/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbleroot%2Fcubbyhole-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumbleroot%2Fcubbyhole-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbleroot%2Fcubbyhole-server/lists"}