{"id":13413635,"url":"https://github.com/firstrow/tcp_server","last_synced_at":"2025-03-14T19:32:51.339Z","repository":{"id":21853481,"uuid":"25176775","full_name":"firstrow/tcp_server","owner":"firstrow","description":"golang tcp server","archived":true,"fork":false,"pushed_at":"2021-11-10T09:30:31.000Z","size":26,"stargazers_count":426,"open_issues_count":4,"forks_count":143,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-07-31T20:52:37.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/firstrow.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":"2014-10-13T20:38:42.000Z","updated_at":"2024-07-07T19:26:30.000Z","dependencies_parsed_at":"2022-08-09T10:10:15.409Z","dependency_job_id":null,"html_url":"https://github.com/firstrow/tcp_server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstrow%2Ftcp_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstrow%2Ftcp_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstrow%2Ftcp_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstrow%2Ftcp_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstrow","download_url":"https://codeload.github.com/firstrow/tcp_server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221498771,"owners_count":16833059,"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-07-30T20:01:45.051Z","updated_at":"2024-10-26T05:31:12.475Z","avatar_url":"https://github.com/firstrow.png","language":"Go","readme":"[![Build Status](https://travis-ci.org/firstrow/tcp_server.svg?branch=master)](https://travis-ci.org/firstrow/tcp_server)\n\n# TCPServer\nPackage tcp_server created to help build TCP servers faster.\n\n### Install package\n\n``` bash\ngo get -u github.com/firstrow/tcp_server@latest\n```\n\n### Usage:\n\nNOTICE: `OnNewMessage` callback will receive new message only if it's ending with `\\n`\n\n``` go\npackage main\n\nimport \"github.com/firstrow/tcp_server\"\n\nfunc main() {\n\tserver := tcp_server.New(\"localhost:9999\")\n\n\tserver.OnNewClient(func(c *tcp_server.Client) {\n\t\t// new client connected\n\t\t// lets send some message\n\t\tc.Send(\"Hello\")\n\t})\n\tserver.OnNewMessage(func(c *tcp_server.Client, message string) {\n\t\t// new message received\n\t})\n\tserver.OnClientConnectionClosed(func(c *tcp_server.Client, err error) {\n\t\t// connection with client lost\n\t})\n\n\tserver.Listen()\n}\n```\n\n# Contributing\n\nTo hack on this project:\n\n1. Install as usual (`go get -u github.com/firstrow/tcp_server`)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Ensure everything works and the tests pass (`go test`)\n4. Commit your changes (`git commit -am 'Add some feature'`)\n\nContribute upstream:\n\n1. Fork it on GitHub\n2. Add your remote (`git remote add fork git@github.com:firstrow/tcp_server.git`)\n3. Push to the branch (`git push fork my-new-feature`)\n4. Create a new Pull Request on GitHub\n\nNotice: Always use the original import path by installing with `go get`.\n","funding_links":[],"categories":["Networking","\u003cspan id=\"网络-networking\"\u003e网络 Networking\u003c/span\u003e","网络","網絡","网络相关库","Relational Databases"],"sub_categories":["Transliteration","Uncategorized","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Advanced Console UIs","交流","音译","Strings","高級控制台界面","高级控制台界面","暂未分类","暂未分类这些库被放在这里是因为其他类别似乎都不适合。"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstrow%2Ftcp_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstrow%2Ftcp_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstrow%2Ftcp_server/lists"}