Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

async-sockets-cpp

> 编程语言
Open source

Simple thread-based asynchronous TCP & UDP Socket classes in C++.

385 stars0 likes1 views
WebsiteGitHub

About

Simple thread-based asynchronous TCP & UDP Socket classes in 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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++asynchronous-socketscppsimplesocket

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

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