{"id":25982550,"url":"https://github.com/ap-dev-at-home/ysocket","last_synced_at":"2026-04-19T00:06:41.361Z","repository":{"id":279480028,"uuid":"938911844","full_name":"ap-dev-at-home/YSocket","owner":"ap-dev-at-home","description":"Library providing diverse means of socket communication.","archived":false,"fork":false,"pushed_at":"2025-02-25T19:08:43.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T20:19:13.152Z","etag":null,"topics":["inter-process-communication","ipc","microservice-communication","microservices","named-pipes","pipes","sockets","tcp","udp"],"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/ap-dev-at-home.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":"2025-02-25T17:36:32.000Z","updated_at":"2025-02-25T19:08:46.000Z","dependencies_parsed_at":"2025-02-25T20:19:14.656Z","dependency_job_id":"783b3e92-086e-46ec-8d9b-3fe1e0304857","html_url":"https://github.com/ap-dev-at-home/YSocket","commit_stats":null,"previous_names":["ap-dev-at-home/ysocket"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap-dev-at-home%2FYSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap-dev-at-home%2FYSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap-dev-at-home%2FYSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ap-dev-at-home%2FYSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ap-dev-at-home","download_url":"https://codeload.github.com/ap-dev-at-home/YSocket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242000437,"owners_count":20055675,"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":["inter-process-communication","ipc","microservice-communication","microservices","named-pipes","pipes","sockets","tcp","udp"],"created_at":"2025-03-05T09:32:45.419Z","updated_at":"2026-04-19T00:06:41.319Z","avatar_url":"https://github.com/ap-dev-at-home.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YSocket\n\nYSocket is a C# Library to provide communication in the following categories\n\n- Inter process\n  - Named Pipes\n- Microservices (still working on it...)\n  - Tcp-Sockets\n- Gaming (still working on it...)\n  - Udp-Sockets\n\n# Inter Process Communication (IPC)\n\nPipeServer/PipeClient introduces an inter process communication model between processes based on c# class types, using named pipes.\nServer and Client can setup their handlers on a shared class model and receive or send queries/commands on them.\n\n### Named Pipe Server\n```csharp\nusing YSocket.Ipc;\n\n//- Setup Named Pipe Server\n//- Register Command/Query Handlers\n\nclass ServerPipeHandler : IDisposable\n{\n    private readonly PipeServer pipeServer;\n    \n    public ServerPipeHandler(\n        CancellationToken? cancellationToken = null)\n    {\n        var pipeSecurity = new PipeSecurity();\n        pipeSecurity.AddAccessRule(new PipeAccessRule(\n            new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null),\n            PipeAccessRights.ReadWrite,\n            AccessControlType.Allow));\n\n        this.pipeServer = new(Names.PIPE_SERVER_GUID, pipeSecurity, cancellationToken);\n        \n        this.RegisterPipeHandlers();\n        \n        this.pipeServer.Start();\n    }\n\n    private void RegisterPipeHandlers()\n    {\n        this.pipeServer.Handle\u003cExitCommand\u003e(exitCommand =\u003e\n        {\n            //exitcommand received - stop application\n        });\n\n        this.pipeServer.Handle\u003cStatusInformationQuery\u003e(statusInformationQuery =\u003e\n        {\n            //statusinformationquery received - respond\n            this.pipeServer.Send(new StatusInformation { ... });\n        });\n    }\n\n    public void Dispose()\n    {\n        this.pipeServer.Dispose();\n    }\n}\n```\n\n### Named Pipe Client\n```csharp\nusing YSocket.Ipc;\n\n//- Setup Named Pipe Client\n//- Register Command/Query Handlers\n\nclass ClientPipeHandler : IDisposable\n{\n    private readonly PipeClient pipeClient;\n    \n    internal ClientPipeHandler(\n        CancellationToken? cancellationToken)\n    {\n        this.pipeClient = new(Names.PIPE_SERVER_GUID, \n            cancellationToken: cancellationToken);\n    }\n\n    internal void RegisterPipeHandlers()\n    {\n        this.pipeClient.Handle\u003cStatusInformation\u003e(statusInformation =\u003e\n        {\n            //process status information\n        });\n    }\n\n    internal async Task\u003cbool\u003e Connect()\n    {\n        var retry = 0;\n        var success = false;\n\n        do\n        {\n            success = await this.pipeClient.Connect(2500);\n            if (success == true)\n            {\n                break;\n            }\n        } while (retry++ \u003c 3);\n\n        return await Task.FromResult(success);\n    }\n\n    internal bool QueryStatusInformation()\n    {\n        try\n        {\n            this.pipeClient.Send(new StatusInformationQuery());\n        }\n        catch (Exception ex)\n        {\n            return false;\n        }\n    \n        return true;\n    }\n\n    internal bool TerminateServer()\n    {\n        try\n        {\n            this.pipeClient.Send(new ExitCommand());\n        }\n        catch (Exception ex)\n        {\n            return false;\n        }\n    \n        return true;\n    }\n\n    public void Dispose()\n    {\n        this.pipeClient.Dispose();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap-dev-at-home%2Fysocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fap-dev-at-home%2Fysocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fap-dev-at-home%2Fysocket/lists"}