{"id":17022093,"url":"https://github.com/trigary/simplenetty","last_synced_at":"2025-04-12T10:14:24.556Z","repository":{"id":193083834,"uuid":"138774781","full_name":"Trigary/SimpleNetty","owner":"Trigary","description":"A simple, asynchronous, event driven and highly performant Netty wrapper.","archived":false,"fork":false,"pushed_at":"2021-02-06T13:16:30.000Z","size":18,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T10:14:13.237Z","etag":null,"topics":["api","java","library","netty","networking","packet","packets","simple","simple-api"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Trigary.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}},"created_at":"2018-06-26T18:01:52.000Z","updated_at":"2022-12-30T17:34:04.000Z","dependencies_parsed_at":"2023-09-06T18:30:30.694Z","dependency_job_id":null,"html_url":"https://github.com/Trigary/SimpleNetty","commit_stats":null,"previous_names":["trigary/simplenetty"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trigary%2FSimpleNetty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trigary%2FSimpleNetty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trigary%2FSimpleNetty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trigary%2FSimpleNetty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trigary","download_url":"https://codeload.github.com/Trigary/SimpleNetty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550632,"owners_count":21122934,"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":["api","java","library","netty","networking","packet","packets","simple","simple-api"],"created_at":"2024-10-14T07:09:19.605Z","updated_at":"2025-04-12T10:14:24.534Z","avatar_url":"https://github.com/Trigary.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleNetty [![](https://jitpack.io/v/Trigary/SimpleNetty.svg)](https://jitpack.io/#Trigary/SimpleNetty)\n\nA wrapper around the Netty framework, which makes it easy to use\nwhile maintaining its most powerful aspects:\nit is asynchronous, event driven and highly performant.\n\n## Main differences\n\nThere are three main features this wrapper adds to Netty:\n - Straight forward server/client initialization and\n binding/connecting\n - An extendable class instance is bound to each connected client\n allowing easy state management (eg. login checks)\n - Provide the base class of all transmitted data and a\n serializer, deserializer for it and worry about\n bytes, serialization no more\n \n## Switching to / from Netty\n\nSwitching between plain Netty and this wrapper is extremely easy.\nThe same thread model is used, there is no need to redo the event\nlisteners. There is always a simple way in this wrapper to access\nNetty directly, giving you the same freedom as Netty provides.\n\n## Documentation\n\n - [JavaDocs](http://trigary.hu/javadocs/simple-netty/)\n - [Server reference](server.md)\n - [Client reference](client.md)\n\n## Importing\n\nYou can add SimpleNetty as a dependency as follows:\n\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n   \u003cid\u003ejitpack.io\u003c/id\u003e\n   \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n \u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.Trigary\u003c/groupId\u003e\n  \u003cartifactId\u003eSimpleNetty\u003c/artifactId\u003e\n  \u003cversion\u003e1.0\u003c/version\u003e\n \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nPlease note that Netty is not shaded into SimpleNetty,\nyou have to add it yourself.\n\n## Example\n\nYou can check out the SimpleNettyExample folder for a\nminimalistic, but complete chat client-server implementation.\n\nThe following tiny code snippet aims to show you what it's like\nto be using SimpleNetty. It's a simple text ECHO server.\n\n```java\n//A serializer, deserializer for the type of the transmitted data: String\nDataSerializer\u003cString\u003e stringSerializer = new DataSerializer\u003cString\u003e() {\n\t@Override\n\tpublic byte[] serialize(String data) {\n\t\treturn data.getBytes(StandardCharsets.US_ASCII);\n\t}\n\t\n\t@Override\n\tpublic String deserialize(byte[] bytes) {\n\t\treturn new String(bytes, StandardCharsets.US_ASCII);\n\t}\n\t\n\t@Override\n\tpublic Class\u003cString\u003e getType() {\n\t\treturn String.class;\n\t}\n};\n\n//Instantiate and initialize a new Server.\n//ServerClient is the class which is bound to all connected clients.\nServer\u003cServerClient\u003cString\u003e, String\u003e server = new Server\u003c\u003e(stringSerializer, ServerClient::new);\nserver.onReceived((client, data) -\u003e client.send(data));\n\n//Bind the server to no specified address, but to the port 800.\nserver.start(null, 800);\n\n//Instantiate and initialize a new Client.\nClient\u003cString\u003e client = new Client\u003c\u003e(stringSerializer);\nclient.onConnected(() -\u003e client.send(\"Hello Server!\"));\nclient.onReceived(System.out::println);\n\n//Connect to the localhost address on the port 800 without any timeout.\nclient.connect(\"localhost\", 800, 0);\n```\n\n##\n\nThis project was inspired by\n[SimpleNet](https://github.com/jhg023/SimpleNet/),\nty [Jacob](https://github.com/jhg023)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrigary%2Fsimplenetty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrigary%2Fsimplenetty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrigary%2Fsimplenetty/lists"}