{"id":37027033,"url":"https://github.com/tix320/sonder","last_synced_at":"2026-01-14T03:11:48.856Z","repository":{"id":53165765,"uuid":"234788889","full_name":"tix320/sonder","owner":"tix320","description":"Client-server high level abstraction library.","archived":false,"fork":false,"pushed_at":"2022-11-16T02:41:44.000Z","size":744,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-26T22:09:54.215Z","etag":null,"topics":["annotations-marks","java","lightweight","network","rpc","rpc-interfaces","rpc-service","socket","socket-programming","tcp","tcp-protocol","topic"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tix320.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}},"created_at":"2020-01-18T19:50:13.000Z","updated_at":"2022-08-07T10:40:47.000Z","dependencies_parsed_at":"2022-09-14T05:50:46.438Z","dependency_job_id":null,"html_url":"https://github.com/tix320/sonder","commit_stats":null,"previous_names":[],"tags_count":41,"template":null,"template_full_name":null,"purl":"pkg:github/tix320/sonder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tix320%2Fsonder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tix320%2Fsonder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tix320%2Fsonder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tix320%2Fsonder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tix320","download_url":"https://codeload.github.com/tix320/sonder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tix320%2Fsonder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["annotations-marks","java","lightweight","network","rpc","rpc-interfaces","rpc-service","socket","socket-programming","tcp","tcp-protocol","topic"],"created_at":"2026-01-14T03:11:48.034Z","updated_at":"2026-01-14T03:11:48.843Z","avatar_url":"https://github.com/tix320.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonder\n\n## Description\n\nSonder is a Java library providing TCP client-server asynchronous communication on high level abstraction. It's\nimplemented over NIO encapsulating hard work of selectors and some byte-level packet protocol.\n\n## Requirements\n\n```\nJava 11 or higher.\n```\n\n## Maven Dependency\n\n```xml\n\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.github.tix320\u003c/groupId\u003e\n\t\u003cartifactId\u003esonder\u003c/artifactId\u003e\n\t\u003cversion\u003e2.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nBellow a small example to demonstrate client-server communication. For the detailed information about the internal\nworking and usage please see the [documentation](https://github.com/tix320/sonder/wiki).\n\n##### Example\n\n```java\npackage com.github.tix320.sonder.readme;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\n\nimport com.github.tix320.kiwi.api.reactive.observable.MonoObservable;\nimport com.github.tix320.sonder.api.client.SonderClient;\nimport com.github.tix320.sonder.api.client.rpc.ClientRPCProtocol;\nimport com.github.tix320.sonder.api.common.rpc.Endpoint;\nimport com.github.tix320.sonder.api.common.rpc.Origin;\nimport com.github.tix320.sonder.api.server.SonderServer;\nimport com.github.tix320.sonder.api.server.rpc.ServerRPCProtocol;\n\n@Endpoint(\"someService\")\nclass ServerEndpoint {\n\n\t@Endpoint(\"someMethod\")\n\tpublic Integer getLengthOfString(String s) {\n\t\treturn s.length();\n\t}\n}\n\nclass ServerTest {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\t// Creating protocol for communication\n\t\tServerRPCProtocol rpcProtocol = ServerRPCProtocol.builder()\n\t\t\t\t.registerEndpointClasses(ServerEndpoint.class)\n\t\t\t\t.build();\n\n\t\t// Creating the server itself and registering the protocol\n\t\tSonderServer sonderServer = SonderServer.forAddress(new InetSocketAddress(8888))\n\t\t\t\t.registerProtocol(rpcProtocol)\n\t\t\t\t.build();\n\n\t\tsonderServer.events()\n\t\t\t\t.newConnections()\n\t\t\t\t.subscribe(client -\u003e System.out.printf(\"Client %s connected\", client.getId()));\n\n\t\tsonderServer.events()\n\t\t\t\t.deadConnections()\n\t\t\t\t.subscribe(client -\u003e System.out.printf(\"Client %s disconnected\", client.getId()));\n\n\t\t// start the server\n\t\tsonderServer.start();\n\t}\n}\n\n@Origin(\"someService\")\ninterface ClientOrigin {\n\n\t@Origin(\"someMethod\")\n\tMonoObservable\u003cInteger\u003e getLengthOfString(String s);\n}\n\nclass ClientTest {\n\tpublic static void main(String[] args) throws IOException {\n\t\t// Creating protocol for communication\n\t\tClientRPCProtocol rpcProtocol = ClientRPCProtocol.builder()\n\t\t\t\t.registerOriginInterfaces(ClientOrigin.class)\n\t\t\t\t.build();\n\n\t\t// Creating the client itself and registering the protocol\n\t\tSonderClient sonderClient = SonderClient.forAddress(new InetSocketAddress(\"localhost\", 8888))\n\t\t\t\t.registerProtocol(rpcProtocol)\n\t\t\t\t.build();\n\n\t\tsonderClient.events().connectionState().subscribe(state -\u003e {\n\t\t\tswitch (state) {\n\t\t\t\tcase IDLE:\n\t\t\t\t\tSystem.out.println(\"Initial state or disconnected\");\n\t\t\t\tcase CONNECTED:\n\t\t\t\t\tSystem.out.println(\"Connected to server\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase CLOSED:\n\t\t\t\t\tSystem.out.println(\"Connection closed by user\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\t\t// connect to server\n\t\tsonderClient.start();\n\n\t\t// Get RPC interface for some request\n\t\tClientOrigin clientOrigin = rpcProtocol.getOrigin(ClientOrigin.class);\n\n\t\t// Call RPC method and subscribe to response\n\t\tclientOrigin.getLengthOfString(\"my_first_rpc_call\").subscribe(length -\u003e {\n\t\t\tSystem.out.println(length);\n\t\t\tassert length == 17;\n\t\t});\n\t}\n}\n```\n\n## Credits\n\n- Tigran Sargsyan - **[tix320](https://github.com/tix320).**\n\n## License\nThis project is licensed under the Apache License - see the [LICENSE](https://github.com/tix320/sonder/blob/master/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftix320%2Fsonder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftix320%2Fsonder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftix320%2Fsonder/lists"}