{"id":20975988,"url":"https://github.com/banyc/socketbackendframework","last_synced_at":"2025-10-04T21:19:19.291Z","repository":{"id":116717775,"uuid":"400728160","full_name":"Banyc/SocketBackendFramework","owner":"Banyc","description":"Layer-4 generic-purpose backend. A backend framework on top of transport layer for relay network model.","archived":false,"fork":false,"pushed_at":"2021-12-16T15:53:56.000Z","size":695,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T05:49:07.373Z","etag":null,"topics":["framework","layer4","pipeline","relay-server"],"latest_commit_sha":null,"homepage":"","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/Banyc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-28T07:13:45.000Z","updated_at":"2023-10-31T14:30:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"9dc58f21-ebf7-40e0-9e2f-48bca5f0f69a","html_url":"https://github.com/Banyc/SocketBackendFramework","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/Banyc%2FSocketBackendFramework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2FSocketBackendFramework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2FSocketBackendFramework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2FSocketBackendFramework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Banyc","download_url":"https://codeload.github.com/Banyc/SocketBackendFramework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243374326,"owners_count":20280661,"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":["framework","layer4","pipeline","relay-server"],"created_at":"2024-11-19T04:48:35.274Z","updated_at":"2025-10-04T21:19:14.252Z","avatar_url":"https://github.com/Banyc.png","language":"C#","readme":"# Socket Back-End Framework\n\n## Architecture\n\n### Relay Model\n\n![architecture](img/arch.relay.drawio.png)\n\n### Request-Response Model\n\n(deprecated)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003c/summary\u003e\n\n![architecture](img/arch.drawio.png)\n\n\u003c/details\u003e\n\n## Features\n\n-   Each configurable module has a clear responsibility.\n-   Business logic decouples from transport infrastructure and pipelines.\n-   It both supports the relay network model or the request-response network model.\n-   Controllers can have different pipeline domains sent application messages.\n-   It supports custom protocols in nature.\n\n## How to use\n\nThe project `SocketBackendFramework.Relay.Sample` gives a simple example of using the framework. A new project can take this sample as a boilerplate.\n\n## Components\n\n-   TransportAgent := a wrapped socket handler.\n-   TransportMapper := an object that organizes many transportAgents.\n    -   It is only configurable from config.json, not from user code.\n-   PacketContext := an object that carries information and flows between a transportMapper and one of its transportAgents.\n-   MiddlewareContext := an object that carries information and flows within a pipeline.\n    -   Users should implement it.\n    -   Usually, a middlewareContext should bring a packetContext.\n-   ContextAdaptor := a convertor between packetContexts and midlewareContexts.\n    -   It acts as an adaptor between a pipeline and a transportMapper.\n        -   TransportMappers only accept packetContexts.\n        -   Pipelines only accept middlewareContexts.\n-   Pipeline := a stack-like data structure containing several middlewares.\n    -   Those middlewares decorate the middlewareContexts that pass through the pipeline.\n    -   When the middlewareContexts go to the bottom of the pipeline, they should contain information ready to use by controllers.\n    -   When the middlewareContexts go to the top of the pipeline, each should contain a complete packetContext ready to use by transportAgents.\n-   PipelineDomain := a virtual area including a pipeline and a dedicated transportMapper.\n-   Workflow := a virtual area that owns a complete and independent back-end server.\n    -   No data exchange is allowed between workflows.\n-   WorkflowPool := a virtual area that collects all the running workflows. \n-   Controller := a object that majorly involves business logic.\n\n## Notices\n\n-   Disposal of socket handlers\n    -   When disconnection hits a socket handler, the organizer of many socket handlers should dispose the socket handler.\n        -   The organizer can be `Listener` or `TransportMapper`.\n            -   `Listener` disposes `TcpSessionHandler`.\n            -   `TransportMapper` disposes `TransportClient`.\n    -   A timeout only directly activates a disconnection, not a disposal.\n    -   When an organizer decides to dispose one of the socket handlers, it should do the disposal before telling controllers about the disconnection.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanyc%2Fsocketbackendframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanyc%2Fsocketbackendframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanyc%2Fsocketbackendframework/lists"}