NovusNet is a lightweight C++ networking library designed to streamline client-server communication without the complexity of larger frameworks. Ideal for indie developers and beginners, it allows setup in under 10 lines of code, enabling focus on building rather than boilerplate. While currently aimed at Linux users, it promises an easier networking experience for all.
NovusNet is a lightweight C++ networking library designed to streamline client-server communication. Geared towards indie developers and beginners, NovusNet simplifies the often complex task of setting up networking in projects, allowing developers to establish a server-client connection with minimal code—often in fewer than ten lines.
Key Features
- Simplicity: With NovusNet, beginners can set up networking without the typical setup challenges associated with larger libraries such as Boost.Asio. This allows for faster development and reduces the learning curve for new programmers.
- Minimalistic: Focuses on essential functionalities without unnecessary complexity, making it ideal for projects that do not require extensive networking features.
Getting Started
NovusNet enables effortless integration into existing projects. Below are simple code examples illustrating how to implement a basic server and client:
Example Code
Server Implementation
#include "nn.hpp"
#include <iostream>
#include <chrono>
int main(){
runServer(9090);
while(true){
onMessage([](int clientID, std::string msg){
std::cout << "Client " << clientID << ": " << msg << "\n";
});
}
}
Client Implementation
#include "nn.hpp"
#include <iostream>
int main(){
std::string msg;
// runClient(ip, port) connects to a server
int client = runClient("127.0.0.1", 9090);
while(true){
std::getline(std::cin, msg);
// sendMsg(string msg) sends data as a string
sendMsg(msg, client);
}
return 0;
}
These code snippets can also be found in the src/client.cpp and src/server.cpp files within the repository.
Important Notes
- Security: Please be aware that connections established using NovusNet are not encrypted. Exposing the code to the internet should be done with caution.
- Development Status: NovusNet is currently in early development. Users may encounter occasional bugs and are encouraged to report any issues.
- Platform Support: Currently, NovusNet is supported on Linux systems only. Windows support is planned for future releases, contingent upon stabilizing the Linux version.
By using NovusNet, the focus shifts towards product development without the burden of repetitive boilerplate code, enhancing productivity in the development cycle.
No comments yet.
Sign in to be the first to comment.