{"id":20500967,"url":"https://github.com/caesay/nearsight","last_synced_at":"2025-03-05T19:41:06.178Z","repository":{"id":117004142,"uuid":"49919915","full_name":"caesay/NearSight","owner":"caesay","description":"A fresh take on RPC.","archived":false,"fork":false,"pushed_at":"2016-02-20T22:42:38.000Z","size":418,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T06:58:38.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"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/caesay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-19T02:23:13.000Z","updated_at":"2016-01-19T02:25:42.000Z","dependencies_parsed_at":"2023-05-05T17:31:26.466Z","dependency_job_id":null,"html_url":"https://github.com/caesay/NearSight","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caesay%2FNearSight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caesay%2FNearSight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caesay%2FNearSight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caesay%2FNearSight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caesay","download_url":"https://codeload.github.com/caesay/NearSight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242096728,"owners_count":20071244,"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":[],"created_at":"2024-11-15T18:23:36.378Z","updated_at":"2025-03-05T19:41:06.145Z","avatar_url":"https://github.com/caesay.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"#NearSight\nJust another RPC library. It does some important stuff that WCF can't do, and the messaging protocol is a very compact binary format (uses much less bandwidth than WCF)\n___________________\n\n##Notable Features:\n0. Two-way streams: pass a stream object as a method parameter or as a return parameter.\n0. CLR event propagation: server defines events, client can subscribe and get notified when they execute\n0. Return services from services: You can return a decorated object as the return value of a method call from another service and the client can call methods on the returned object, too. (serviceception!)\n0. Turn a synchronous server API call into an (truly) asynchronous client call.\n0. Automatic SSL handling, just provide a x509 certificate.\n0. Session persistence: If a client disconnects because of a network error, it can re-connect and resume a session (your code won't even know that the network issue happened)\n0. \u003cdel\u003eBuilt in authentication\u003c/del\u003e (removed for api improvements. possibly re-introduce this in the future.)\n\n______________\n\n##Usage:\n\n#### Define service interface and implementation:\n```csharp\n// define interface\n[RContractProvider]\npublic interface IRemoterTest\n{\n    [RProperty]\n    string MyProperty { get; set; }\n\n    [REvent]\n    event EventHandler\u003cPropertyChangedEventArgsEx\u003e PropertyChanged;\n\n    [ROperation]\n    int Add(int one, int two);\n}\n\n// implement interface\npublic class RemoterTest : IRemoterTest\n{\n    public string MyProperty\n    {\n        get { return _myPropertyBacking; }\n        set\n        {\n            _myPropertyBacking = value;\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgsEx(nameof(MyProperty), value));\n        }\n    }\n\n    public event EventHandler\u003cPropertyChangedEventArgsEx\u003e PropertyChanged;\n    private string _myPropertyBacking;\n\n    public int Add(int one, int two)\n    {\n        MyProperty = (one + two).ToString();\n        return one + two;\n    }\n}\n```\n\n#### Run server and execute methods:\n```csharp\n// create a server\nRemoterServer server = new RemoterServer(7750);\nserver.AddService\u003cIRemoterTest, RemoterTest\u003e(\"/path\");\nserver.Start();\n\n// create a proxy\nRemoterFactory factory = new RemoterFactory(\"tcp://localhost:7750\");\nfactory.Open();\nIRemoterTest proxy = factory.OpenServicePath\u003cIRemoterTest\u003e(\"/path\");\n\n// call methods\nint addRes = proxy.Add(15, 10); // should be 25\n```\n_______________\n\n##License\n\nCreative Commons Attribution-ShareAlike 4.0 International \u003cbr/\u003e\n(CC BY-SA 4.0) \u003cbr/\u003e\nhttp://creativecommons.org/licenses/by-sa/4.0/\n\n_______________\n\n##Credits\n0. Caelan (Me) [caelantsayler]at[gmail]com\n1. Contributers of RT.Util: https://github.com/RT-Projects/RT.Util\n\nFeel free to open an issue if you have questions or find a bug.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaesay%2Fnearsight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaesay%2Fnearsight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaesay%2Fnearsight/lists"}