{"id":30642390,"url":"https://github.com/zahi1/simplerpc-system","last_synced_at":"2025-08-31T02:32:36.113Z","repository":{"id":311673760,"uuid":"1044310577","full_name":"zahi1/simplerpc-system","owner":"zahi1","description":"Distributed gas pressure simulation using SimpleRPC (.NET 8): one server (container) plus multiple input/output clients; contract-first, logged, safe concurrent updates.","archived":false,"fork":false,"pushed_at":"2025-08-25T21:17:49.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T23:25:44.562Z","etag":null,"topics":["client-server","csharp","distributed-systems","rpc","simple-rpc"],"latest_commit_sha":null,"homepage":"","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/zahi1.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":"2025-08-25T13:46:32.000Z","updated_at":"2025-08-25T21:17:52.000Z","dependencies_parsed_at":"2025-08-25T23:25:50.255Z","dependency_job_id":"93cc3aa8-9161-4c29-80c5-362a862e4e8b","html_url":"https://github.com/zahi1/simplerpc-system","commit_stats":null,"previous_names":["zahi1/simplerpc-system"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zahi1/simplerpc-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahi1%2Fsimplerpc-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahi1%2Fsimplerpc-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahi1%2Fsimplerpc-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahi1%2Fsimplerpc-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zahi1","download_url":"https://codeload.github.com/zahi1/simplerpc-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahi1%2Fsimplerpc-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272931202,"owners_count":25017317,"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-08-31T02:00:09.071Z","response_time":79,"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":["client-server","csharp","distributed-systems","rpc","simple-rpc"],"created_at":"2025-08-31T02:32:35.056Z","updated_at":"2025-08-31T02:32:36.058Z","avatar_url":"https://github.com/zahi1.png","language":"C#","readme":"# simplerpc-system: Gas Pressure RPC Simulation\n\nA .NET 8 SimpleRPC-based distributed simulation of gas pressure in a container with three components:\n- Server: container state and business logic (pressure, mass, temperature, safety limits)\n- Input clients: add gas mass when pressure is below the lower limit\n- Output clients: remove gas mass when pressure is above the upper limit\n\n## Project goals\n- Demonstrate contract-first remote interactions using SimpleRPC\n- Keep contracts RPC-agnostic and separate from business logic\n- Support many concurrent clients safely without races or deadlocks\n\n## Architecture\n- GasContract (class library)\n  - `IGasContainerService` defines the remote service contract.\n- gasPressure (server)\n  - Implements the service and hosts SimpleRPC.\n  - Every ~2 seconds updates temperature with a random delta and recomputes pressure.\n  - Resets simulation on implosion/explosion.\n- inputClient (client)\n  - If pressure \u003c lower limit, generates positive random mass and calls `AddMass`.\n- outputClient (client)\n  - If pressure \u003e upper limit, generates positive random mass and calls `RemoveMass`.\n\n### Communication flow\n1. Clients obtain a proxy for `IGasContainerService` using SimpleRPC and the shared GasContract DLL.\n2. Clients call short, non-blocking methods (get state, add mass, remove mass).\n3. Server validates constraints and applies updates atomically, logs each step.\n4. Server’s timer adjusts temperature; clients react next cycle.\n\n### Lab requirements mapping (summary)\n- One server, unlimited clients: yes\n- Interfaces for contracts: `IGasContainerService`\n- Contract/logic separation: contract lib vs. server/clients\n- No sleeping in service ops: yes (timer runs outside RPC calls)\n- Proxy-based RPC: SimpleRPC proxies\n- No races/deadlocks: serialized updates in server, short calls\n- Continuous cycles: server timer + client loops\n- Separate processes: server and each client run separately\n- Logging: to stdout/files\n\n## How to run\nPrerequisites: .NET SDK 8+\n\nBuild all\n\n```bash\ndotnet build\n```\n\nRun server (terminal 1)\n\n```bash\ndotnet run --project gasPressure\n```\n\nRun one or more input clients (terminal 2+)\n\n```bash\ndotnet run --project inputClient\n```\n\nRun one or more output clients (terminal 3+)\n\n```bash\ndotnet run --project outputClient\n```\n\nConfiguration such as limits/endpoints/logging is in `gasPressure/appsettings.json` (and Development override).\n\n## License\nDefault: MIT (see [`LICENSE`](./LICENSE)).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahi1%2Fsimplerpc-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzahi1%2Fsimplerpc-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahi1%2Fsimplerpc-system/lists"}