Welcome to the pulse::net::udp repository! This project provides raw non-blocking UDP sockets with Go-style ergonomics, implemented in modern C++23. This repository serves as a mirror for easy access and collaboration.
- Asynchronous Communication: Designed for high-performance networking, enabling non-blocking operations.
- Clean API: User-friendly interface that simplifies socket programming.
- Cross-Platform: Works seamlessly across various operating systems.
- No Dependencies: Minimal setup required; no external libraries needed.
- Modern C++23: Utilizes the latest C++ features for enhanced performance and readability.
- Error Handling: Implements
std::expected
for clear and concise error management.
To get started with pulsenet-udp, follow these steps:
-
Clone the repository:
git clone https://github.com/suresh147-ai/pulsenet-udp.git cd pulsenet-udp
-
Build the project using CMake:
mkdir build cd build cmake .. make
-
Install the library:
sudo make install
Here’s a quick overview of how to use pulsenet-udp in your projects.
You can create a UDP socket using the provided API. Here's a simple example:
#include <pulse/net/udp/socket.h>
int main() {
pulse::net::udp::Socket socket;
socket.bind(12345); // Bind to port 12345
// Further socket operations...
}
To send data, use the send
method:
socket.send("Hello, World!", "127.0.0.1", 12345);
Receiving data is just as straightforward:
std::string message;
socket.receive(message);
std::cout << "Received: " << message << std::endl;
You can find detailed examples in the examples
directory. Each example demonstrates different features of the library, such as:
- Simple UDP client-server communication
- Handling multiple connections
- Error handling using
std::expected
We welcome contributions! If you would like to contribute to pulsenet-udp, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
Please ensure that your code follows the existing style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest releases, visit our Releases page. Here, you can download and execute the latest versions of the library.
For questions or feedback, feel free to reach out:
- Email: your-email@example.com
- GitHub: suresh147-ai
We appreciate your interest in pulsenet-udp and look forward to your contributions!