百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

async-sockets-cpp

> 编程语言
开源

基于线程的简单异步 TCP 和 UDP 套接字类在 C++ 中

385 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

基于线程的简单异步 TCP 和 UDP 套接字类在 C++ 中

Asynchronous Sockets for C++

Simple, multithread-based(not thread safe), non-blocking asynchronous Client-Server classes in C++ for TCP & UDP. Creates a thread for every connection. Use mutexes or atomic variables to provide thread-safe functions.

cpp
// Initialize a tcp socket.
TCPSocket tcpSocket;

// Connect to the host.
tcpSocket.Connect("127.0.0.1", 8888, [&] {
    cout << "Connected to the server successfully." << endl;

    // Send String:
    tcpSocket.Send("Hello Server!");
});

Super Easy!

CPU & RAM Usages (with single tcp connection & with single udp server + client):

Lightweight!

Examples:

You can compile all the examples by just going in the examples/ directory and run make in terminal:

  • examples/tcp-client.cpp
  • examples/tcp-server.cpp
  • examples/udp-client.cpp
  • examples/udp-server.cpp

Supported Platforms:

  • Linux
  • MacOS (not tested)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++asynchronous-socketscppsimplesocket

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言