项目作者: CBenoit

项目描述 :
A C++ header only library aiming at providing various asynchronous UDP based sockets.
高级语言: C++
项目地址: git://github.com/CBenoit/RUDP.git
创建时间: 2017-05-07T19:23:50Z
项目社区:https://github.com/CBenoit/RUDP

开源协议:European Union Public License 1.1

下载


RUDP

RUDP is a header only library aiming at providing various asynchronous UDP based sockets such as reliable UDP socket.

Currently it only has a “connection” UDP socket (an UDP socket that handles connections).

RUDP uses some C++14 features and boost libraries (mainly asio and uuid).

[More explanations to come]

Basic usage

Minimal server code:

  1. using boost::asio::ip::udp;
  2. boost::asio::io_service io_service;
  3. rudp::Socket<rudp::BasicHeader> socket(io_service, 512, { udp::v4(), 2000 });
  4. io_service.run();

Minimal client code:

  1. using boost::asio::ip::udp;
  2. boost::asio::io_service io_service;
  3. rudp::Socket<rudp::BasicHeader> socket(io_service, 512);
  4. udp::resolver resolver(io_service);
  5. udp::resolver::query query(udp::v4(), "localhost", "2000");
  6. udp::endpoint remote_endpoint = *resolver.resolve(query);
  7. socket.connect(remote_endpoint);
  8. io_service.run();

To perform any useful task handlers shall be set.

rudp::BasicHeader is the simplest header of RUDP. A rudp::Socket<rudp::BasicHeader> only provides a “connection” UDP socket.

For more complete examples, check the example folder.

License

This work is under the European Union Public License v1.1.

You may get a copy of this license in your language from the European Commission here.

Extract of article 13 :

  1. All linguistic versions of this Licence, approved by the European Commission, have identical value.
  2. Parties can take advantage of the linguistic version of their choice.

Planned

  • Add makefiles
  • Add doxygen documentation.
  • Add time critical protocol.
  • Add reliable order protocol.