{"id":18290623,"url":"https://github.com/shuai132/socketpp","last_synced_at":"2025-06-25T08:39:31.941Z","repository":{"id":124278004,"uuid":"196003921","full_name":"shuai132/SocketPP","owner":"shuai132","description":"a lightweight C++ TCP socket library powered by epoll/kqueue, for study.","archived":false,"fork":false,"pushed_at":"2023-01-15T07:02:53.000Z","size":36,"stargazers_count":24,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T10:33:33.703Z","etag":null,"topics":["epoll","kqueue","socket","tcp","tcp-client","tcp-server","tcp-socket"],"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/shuai132.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":"2019-07-09T12:26:53.000Z","updated_at":"2023-12-07T08:52:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"34746ff7-5ecf-4f56-b3b4-df7f281a9d6d","html_url":"https://github.com/shuai132/SocketPP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shuai132/SocketPP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSocketPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSocketPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSocketPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSocketPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuai132","download_url":"https://codeload.github.com/shuai132/SocketPP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSocketPP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261837898,"owners_count":23217529,"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":["epoll","kqueue","socket","tcp","tcp-client","tcp-server","tcp-socket"],"created_at":"2024-11-05T14:11:40.919Z","updated_at":"2025-06-25T08:39:31.908Z","avatar_url":"https://github.com/shuai132.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DEPRECATED. Please use [asio_net](https://github.com/shuai132/asio_net) instead\n\n# Socket++\n\n[![Build Status](https://www.travis-ci.org/shuai132/SocketPP.svg?branch=master)](https://www.travis-ci.org/shuai132/SocketPP)\n\na lightweight C++ TCP socket library, powered by epoll on Linux platform and kqueue on macOS/Unix.\n\n## Features:\n* High performance and high concurrenc benefit from epoll/kqueue\n* Support send queue with thread safe\n* Automatic memory management and ensure performance by c++ move semantics\n* Multi-instance support\n* Multiplatform support, Linux/macOS and most Unix-like OS.\n\n## Requirements:\n* C++11\n\n## Build:\n```bash\nmkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make\n```\n\n## Usage:\n* simple echo server\n```cpp\n#include \"SocketPP.h\"\n\nusing namespace SocketPP;\n\nint main() {\n    const int port = 6000;\n    TCPServer server(port);\n    server.setRecvHandle([\u0026] (const Message\u0026 message) {\n        server.send(message);\n    });\n    return server.loop();\n}\n```\nand then use nc tools, or run client example:\n```bash\nnc localhost 6000\n```\nor\n```cpp\n#include \"SocketPP.h\"\n\nusing namespace SocketPP;\n\nint main() {\n    const int port = 6000;\n    TCPClient client(\"127.0.0.1\", port);\n    client.setConnHandle([\u0026] (const TCPStream\u0026 stream) {\n        client.send(\"hello\");\n    });\n    client.setRecvHandle([\u0026] (const Message\u0026 message) {\n        printf(\"on receive: msg:%s\", message.rawMsg.toString().c_str());\n    });\n    return client.loop();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuai132%2Fsocketpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuai132%2Fsocketpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuai132%2Fsocketpp/lists"}