{"id":17008406,"url":"https://github.com/davidfowl/streamer","last_synced_at":"2025-03-22T16:30:55.942Z","repository":{"id":14088537,"uuid":"16792409","full_name":"davidfowl/Streamer","owner":"davidfowl","description":"JSON RPC over any bidirectional stream","archived":false,"fork":false,"pushed_at":"2016-02-07T15:16:19.000Z","size":23,"stargazers_count":44,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-14T20:58:19.258Z","etag":null,"topics":[],"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/davidfowl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T05:02:19.000Z","updated_at":"2024-12-22T10:57:01.000Z","dependencies_parsed_at":"2022-08-28T20:50:26.274Z","dependency_job_id":null,"html_url":"https://github.com/davidfowl/Streamer","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/davidfowl%2FStreamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FStreamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FStreamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfowl%2FStreamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfowl","download_url":"https://codeload.github.com/davidfowl/Streamer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244986408,"owners_count":20543009,"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-10-14T05:28:13.122Z","updated_at":"2025-03-22T16:30:55.590Z","avatar_url":"https://github.com/davidfowl.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streamer\n\nRPC over a network should be simpler so here you go. Streamer offers a simple API for RPC over any bidirectional stream.\n\n## NuGet\n\n```\nInstall-Package Streamer\n```\n\n## Server\n\n```C#\nvar server = new TcpListener(IPAddress.Loopback, 1335);\nserver.Start();\n\nwhile (true)\n{\n    var client = await server.AcceptTcpClientAsync();\n\n    // Create a channel to communicate with the client\n    var channel = Channel.CreateServer(client.GetStream());\n\n    // Bind the handler that will handle callbacks\n    channel.Bind(new Handler());\n}\n\n\npublic class Handler\n{\n    public int Increment(int value)\n    {\n        Console.WriteLine(\"Received \" + value);\n\n        return value + 1;\n    }\n}\n\n```\n\n## Client\n\n```C#\nvar client = new TcpClient();\nawait client.ConnectAsync(IPAddress.Loopback, 1335);\n\n// Create a channel so we can communicate with the server\nvar channel = Channel.CreateClient(client.GetStream());\n\n// Invoke a method and get a result\nvar result = await channel.Invoke\u003cint\u003e(\"Increment\");\n```\n\n## Typed Clients\n\n```C#\npublic interface IAdder\n{\n    Task\u003cint\u003e Increment(int value);\n}\n\nvar client = new TcpClient();\nawait client.ConnectAsync(IPAddress.Loopback, 1335);\n\n// Create a channel so we can communicate with the server\nvar channel = new Channel(client.GetStream());\n\n// Create a proxy to the adder interface\nvar adder = channel.As\u003cIAdder\u003e();\n\n// Invoke a method and get a result\nvar result = await adder.Increment(0);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfowl%2Fstreamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfowl%2Fstreamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfowl%2Fstreamer/lists"}