My convoluted implementation of a reliable protocol. If this is to be used, it should be used at most in a local network. Unfortunately, the library is not ready for multithreading yet.
- Installation and support connections (RUDP functionality) - !!ITS NOT TCP!!
- Handle/Send reliable packets (RUDP functionality) - !!ITS NOT TCP!!
- Convenient logging system
- The library is cross-platform
You may have noticed that library included folders with an ending (.a) (.lib), (.dll), (.aar).. You can also use it in C#, but it little uncomfortable, so to make it easier, I created a wrap for C#, so you don’t have to work with the (.dll) and (.aar) directly!
| (Windows C++) | (.lib) | (.dll) | ||
| (Windows C#) | (.dll) | |||
| (Android C#) | (.aar) | |||
| (Unity C#) | (.dll) | (.aar) | ||
| (Linux C++) | (.a) |
- Everything I've added to the library is available to you.
- You have full control over the server and client fields
- (.a) libraries are very easy to use. (Only Linux)
- Build with CMake: you need C++ compiler and Linux or Visual Studio!
- Everything I've added to the library is available to you.
- You have full control over the server and client fields
- (.lib) libraries are very easy to use. (Only Windows)
- Build with CMake: you need C++ compiler and Windows!
- A separate file (ice_net.h) describes the methods you can use. Obviously, the flexibility of (.dll) is less than that of (.lib).
- The (.dll) can be used even in C#, and EVEN in Unity. (Only Windows)
- Build with CMake: you need C++ compiler and Windows!
- A separate file (ice_net.h) describes the methods you can use. Obviously, the flexibility of (.aar) is less than that of (.lib).
- The (.aar) can be used even in C#, and EVEN in Unity. (Only Android)
- Build with CMake: you need C++ compiler and Android NDK!
ice_logger::log_listener = [](std::string& s) { printf(s.c_str()); };
ice_logger::log_error_listener = [](std::string& s) { printf(("\033[31m" + s + "\033[0m").c_str()); };rudp_server* sock = new rudp_server;
sock->socket = new udp_sock;
sock->socket->start(end_point(0, 8080));
sock->try_start();
sock->connection_added_callback = [&](rudp_connection* c)
{
ice_data::write data;
data.add_string("Hello!");
end_point ep = sock->connection_internal_get_remote_ep(c);
sock->send_reliable(ep, data);
};
while (true) sock->update();rudp_client* sock = new rudp_client;
sock->socket = new udp_sock;
sock->socket->start(end_point(0, 0));
sock->connect(end_point("127.0.0.1", 8080));
sock->external_data_callback = [](ice_data::read& d)
{
std::cout << d.get_string() << std::endl;
};
while (true) sock->update();If you work in Unity, I recommend you to use (.aar) and (.dll) at the same time (for correct operation they must be in Assets/Plugins). To work with C# and C++, use P/Invoke, or just download my wrap for unity, in which I did this work.
