基于线程的简单异步 TCP 和 UDP 套接字类在 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.
// 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!
You can compile all the examples by just going in the examples/ directory and run make in terminal:
暂无开放 Issues,或尚未同步最近议题。