Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

Notifications You must be signed in to change notification settings

eminfedar/async-sockets-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

77 Commits

Repository files navigation

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.

// 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

Lightweight!

Examples:

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

Supported Platforms:

  • Linux
  • MacOS (not tested)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

AltStyle によって変換されたページ (->オリジナル) /